Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Calling non void method with results #305

Open
ColonelBundy opened this issue Jan 16, 2022 · 2 comments
Open

[Feature] Calling non void method with results #305

ColonelBundy opened this issue Jan 16, 2022 · 2 comments

Comments

@ColonelBundy
Copy link

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
Copy link
Owner

dsuryd commented Jan 16, 2022

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

@DG4ever
Copy link

DG4ever commented Oct 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants