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

Store listening to actions after dismount #547

Open
Chayemor opened this issue Jun 21, 2018 · 0 comments
Open

Store listening to actions after dismount #547

Chayemor opened this issue Jun 21, 2018 · 0 comments

Comments

@Chayemor
Copy link

I have two store and two components that use the stores (one store per component). The use case implies navigating from one component to the other through a link. In the components I have the following line after getting a WARNING about not calling "setState" when component is unmounted (looking through this forum gave me the answer for that):

componentWillUnmount() { Reflux.Component.prototype.componentWillUnmount.call(this); ... }

My question is in regards to the unmounted store still listening to Actions. So I wanted a single action called loadData to be listened to in both stores. Each store does a different thing based on that action. This action is called by the components on their respective componentDidMount methods. The thing is, when I navigate from one component to the other, when the action loadData gets called, both stores listen to it instead of only the one that was just attached to the component that in turned triggered loadData.

I suppose my question is, am I not supposed to use generic actions like that? I assumed if the stores did not have any mounted components that used them, they wouldn't listen to the actions.

Thank 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

1 participant