Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I listen for changes in my local cursor ? #19

Open
Offirmo opened this issue Feb 1, 2017 · 3 comments
Open

How can I listen for changes in my local cursor ? #19

Offirmo opened this issue Feb 1, 2017 · 3 comments

Comments

@Offirmo
Copy link

Offirmo commented Feb 1, 2017

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

@denis-sokolov
Copy link
Contributor

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".

@Offirmo
Copy link
Author

Offirmo commented Feb 1, 2017

What if we don't use React ?

Anyway, I'm already coding it right now. (Yves here. Hello Denis)

@denis-sokolov
Copy link
Contributor

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants