redux-cursor
redux-cursor copied to clipboard
How can I listen for changes in my local cursor ?
Redux stores have the .subscribe( to listen for changes.
I can't find how to access such a basic function on my local sub-store
Thanks for noticing this. Indeed, there is no such functionality in redux-cursor. Because we don’t have a concept of sub-store, there is nothing to .subscribe on. We only have local state, and changes in that will automatically re-render a particular component using basic React mechanisms.
I could see a feature you request being added, provided there is a good rationale and design behind it. But it would require you to code it yourself, as there are no plans for this feature in the project. =)
Until then, I think it’s safe to close this issue as "unfortunately impossible".
What if we don't use React ?
Anyway, I'm already coding it right now. (Yves here. Hello Denis)
If you re-render from the top, you would not need to do subscribing on the local state. But for performance reasons, sure. In which case this performance improvement is also useful for the React scenario. So by all means, do add the feature, sounds like a good idea.
(Hello, Yves! Didn’t know it’s you.)