mobx-react icon indicating copy to clipboard operation
mobx-react copied to clipboard

Debounce observer like autorunasync in mobx

Open ckwong90 opened this issue 9 years ago • 2 comments

To my understanding, observer wraps the render method in react with autorun and automatically re-renders as observables are changed. AutorunAsync has a debouncing option. Wrapping render around autorunasync when an option is specified so observable changes can be debounced and render after some specified interval.

Is there already an existing solution to debouncing react observers?

Example:

@observe(16) //debounce 16ms
class ReactElement extends Component {...}

ckwong90 avatar Feb 11 '17 23:02 ckwong90

What benefit would that yield? Do you have a real life usecase for such a scenario?

Op zo 12 feb. 2017 om 00:26 schreef Chris Kwong [email protected]:

To my understanding, observer wraps the render method in react with autorun and automatically re-renders as observables are changed. Can an option be implemented such that we can debounce the observables and only render after some specified interval.

@observe(16) //debounce 16ms class ReactElement extends Component {...}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx-react/issues/203, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhM7QxT1mG17v1IkkhSjT0Gd9tl5lks5rbkO4gaJpZM4L-VXL .

mweststrate avatar Feb 14 '17 12:02 mweststrate

https://github.com/mobxjs/mobx-react/issues/533

worudso avatar Aug 23 '18 06:08 worudso