dbrattli / Fable.Reaction

Fable Reaction - Reactive (AsyncRx) for F# Elmish and Fable
http://fablereaction.rtfd.io/
MIT License
142 stars 19 forks source link

Why Async.Start' ? #76

Closed OnurGumus closed 4 years ago

OnurGumus commented 4 years ago

I am seeing this code:

static member Start' (computation:Async<unit>, ?cancellationToken: CancellationToken) : unit =
            #if FABLE_COMPILER
                Async.StartImmediate (computation, ?cancellationToken=cancellationToken)
            #else
                Async.Start (computation, ?cancellationToken=cancellationToken)
            #endif

But in fable Start and StartImmediate are the same thing.

dbrattli commented 4 years ago

Yes, but AsyncRx can be used outside of Fable. Sometimes we want to use Start and not StartImmediate for .NET environments. That could would then trigger a warning with Fable. This is to get rid of that warning.

dbrattli commented 4 years ago

FYI: https://github.com/fable-compiler/Fable/issues/1826

OnurGumus commented 4 years ago

btw there is a plugin for webpack which allows you to suppress warnings by text matching.