dsuryd / dotNetify

Simple, lightweight, yet powerful way to build real-time web apps.
https://dotnetify.net
Other
1.17k stars 164 forks source link

[Feature] Calling non void method with results #305

Open ColonelBundy opened 2 years ago

ColonelBundy commented 2 years ago

Consider the following method:

public string Hello(string input) {
    return "Hello " + input;
}

And then calling it using dispatch

const data = dotnetify.$dispatch({ Hello: "world" });

Data is obviously undefined, could there be a version of $dispatch that returns a promise with the result?

Use case is obviously being able to display loading indicators when fetching information and/or fetching data that does not belong in the usual state of the view model eg. Login with simply a boolean for result.

Thoughts?

dsuryd commented 2 years ago

Sounds like a good feature to have. Thanks for suggesting it!

DG4ever commented 10 months ago

Any news on this? This would be a really nice feature.