Giter Site home page Giter Site logo

Zaid's fromAsync Cmd about elmish HOT 3 CLOSED

AlbertoDePena avatar AlbertoDePena commented on June 15, 2024
Zaid's fromAsync Cmd

from elmish.

Comments (3)

et1975 avatar et1975 commented on June 15, 2024 2

This doesn't offer anything new and could be easier implemented via OfAsync.perform, which I'd actually suggest using instead because it allows for separation between async/IO interface and application messaging as well as correct point of composition for the two.

There's also an open item to re-work how subscriptions work, so that's another reason to use these kinds of functions instead of building on Sub directly.

from elmish.

et1975 avatar et1975 commented on June 15, 2024 1

The difference is in how the computation is started, recall that async in F#, unlike promise or task is "cold", ie. it's a computation in potentia, ie. not running until you explicitly start it. StartImmediate uses current thread to start running a computation, while Start schedules it to run on the background thread. You decide if you want it "at some point later", or you want it to preempt anything else (at least until it hits IO API that will schedule continuation on the background thread regardless).

from elmish.

AlbertoDePena avatar AlbertoDePena commented on June 15, 2024

@et1975

When would I use Cmd.OfAsync.perform or Cmd.OfAsyncImmediate.perform?

from elmish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.