mobx.dart
mobx.dart copied to clipboard
Add support for scheduling reactions
This can be used in tools to slow down reactions for visualizations.
I believe debounce
operation is most universally expected with regards to reactions for visualizations (or for network related stuff). In angular_github_search example I have initially tried to use, delay
parameter of autorun
, but it seams rather delay operation, not waits for some period after interactions are completed (as debounce
)
So I've ended up with Debouncer
utility class.
You can compare these behaviors switching from makeStore
to makeStoreWithMobxDelay
here: https://github.com/mobxjs/mobx.dart/blob/7db7e744d6685c978ef59040997f84e178deb7b7/angular_mobx_examples/github_search/angular_github_search/lib/app_component.dart#L39
Was looking into why the docs mentioned a debounce when it acts like a throttle instead, I guess @vadimtsushko ran into the same thing.
Will open an issue for correcting the docs and another for introducing a proper debounce.