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

shouldSubscribe not working #151

Open
MaxTwentythree opened this issue Jan 31, 2017 · 2 comments
Open

shouldSubscribe not working #151

MaxTwentythree opened this issue Jan 31, 2017 · 2 comments

Comments

@MaxTwentythree
Copy link

Hi,

the option shouldSubscribe does not seem to work.

When I have this ...

const options = {
    shouldSubscribe: (currentProps, nextProps) => {
        console.log(currentProps, nextProps);
        return false;
    }
};

compose(trackerLoader(myLoader), options)(MyComponent);

... the console.log is never triggered, nor does "return false" prevent the loader from reloading.

Am I doing something wrong or is this a bug?

@MaxTwentythree
Copy link
Author

Same issue with 'propsToWatch' btw...

@nkahnfr
Copy link

nkahnfr commented Feb 17, 2017

Hi,

It's working fine for me.

Please note shouldSubscribe is never called on the first run since you need to subscribe to initialize the container.
The function is called when one or more watched properties change for an "initialized" container.
Hope it helps.

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