mobx.dart icon indicating copy to clipboard operation
mobx.dart copied to clipboard

Add support for scheduling reactions

Open pavanpodila opened this issue 6 years ago • 2 comments

This can be used in tools to slow down reactions for visualizations.

pavanpodila avatar Feb 08 '19 13:02 pavanpodila

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

vadimtsushko avatar Mar 04 '19 12:03 vadimtsushko

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.

MisterJimson avatar Jun 02 '20 15:06 MisterJimson