Giter Club home page Giter Club logo

Comments (5)

gullerya avatar gullerya commented on July 17, 2024 1

Design decision made thus far:

  • async/sync changes delivery will be controllable on the level of Observable, nor lower than that (not per observer callback), nether higher - the whole framework
  • the default flavour will remain the same - sync
  • in order to make an Observable to dispatch the changes in async way the following API should be used (pay attention to the second options parameter):
    const oo = Observable.from({ <some object> }, { async: true });
  • changes will be delayed later on in the same task, by queueMicrotask means
  • if the callback causes new changes to be delivered, they'll be dispatched in the next microtask, not the currently running

from object-observer.

gullerya avatar gullerya commented on July 17, 2024

I'm closing this again, I'll state few things to get to it back if needed in the future:

  • it is not really any async unless got for some setTimeout stuff and probably even more relevant - requestAnimationFrame; but as soon as things become that complex - my feeling is that it should be kept consuming application concern; at the end of the day we are already running in some callback context, so it might quite be good enough to just run as fast as possible, synchronously and if any needed - use another streaming patterns to batch / async heavy processing
  • no real use case so far seen for this scenario

from object-observer.

gullerya avatar gullerya commented on July 17, 2024

Reopening this to link to another issue, that actually will benefit from this one. So this is a use-case that justifies and async flavor.

from object-observer.

gullerya avatar gullerya commented on July 17, 2024

As it can be seen, the async behaviour, while not yet justified in itself, may serve the expected API behaviour like an Object.assign flow. In that use-case, while the native behaviour is to perform each and every property assignment on it's own, thus causing the changes delivery one per callback, the expected Observable API behaviour is to get the changes in batch. Async management of the changes delivery is enabler for that step.

from object-observer.

gullerya avatar gullerya commented on July 17, 2024

implemented in 3.2.0

from object-observer.

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.