You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to add the following shorthands to make working with reactive vars/views easier (which are best handled asynchronously, instead of reading their values directly):
Allowing Var<'T> and View<'T> to participate in async let! expressions:
[<AutoOpen;JavaScript>]moduleExtensions =typeAsyncBuilderwithmemberthis.Bind(var:Var<'T>,continuation:'T ->Async<'U>):Async<'U>=
var.View |> View.GetAsync |>fun res -> async.Bind(res, continuation)memberthis.Bind(view:View<'T>,continuation:'T ->Async<'U>):Async<'U>=
view |> View.GetAsync |>fun res -> async.Bind(res, continuation)
The latter would be especially useful, and would allow the following:
MainTemplate.ContactForm()
.OnSend(fun e ->async{// Instead of reading e.Vars.Name.View |> View.GetAsync,// a much nicer way would be:let!name= e.Vars.Name
// ... and same shorthand for views:let!email= e.Vars.Email.View
...
The text was updated successfully, but these errors were encountered:
I propose to add the following shorthands to make working with reactive vars/views easier (which are best handled asynchronously, instead of reading their values directly):
Var.GetAsync
, as a counterpart toView.GetAsync
:Allowing
Var<'T>
andView<'T>
to participate in asynclet!
expressions:The latter would be especially useful, and would allow the following:
The text was updated successfully, but these errors were encountered: