Skip to content
This repository

Simplify JS event callback pattern #25

Open
dbaeumer opened this Issue March 26, 2013 · 4 comments

4 participants

dbaeumer Tomasz Janczuk Keith Dahlby Glenn Block
dbaeumer

When calling back into JS from CLR the JS function has to invoke a passed in callback to the CLR again to continue the CLR code in case of an await on the call to JS. If CLR only wants to fire an event in JS and doesn't need to await the return of the callback the pattern can be simplified.

Tomasz Janczuk
Owner

I wonder if it makes sense to generalize it a bit to supporting Action<object> delegates in addition to Func<object,Task<object>>. Both ways. Thoughts?

Tomasz Janczuk
Owner

@glennblock opinion?

Keith Dahlby

:+1: for Action<object> mapping to a JS return value of undefined.

Glenn Block
Collaborator

For simplifying fire and forget type calls this makes sense as it won't block the main app thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.