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

PubSub events are not being triggered #10

Open
nicolasiensen opened this issue Jul 6, 2015 · 16 comments
Open

PubSub events are not being triggered #10

nicolasiensen opened this issue Jul 6, 2015 · 16 comments

Comments

@nicolasiensen
Copy link

Hey,

I'm trying to listen to j-toker events with PubSub, but it seems that no event is been triggered by j-toker.

I've tried to place this code

PubSub.subscribe('auth', function(data){
  console.log("auth");
});

And after calling Auth.emailSignIn, the PubSub auth was not triggered.

Thoughts?

@nicolasiensen nicolasiensen changed the title Can't get PubSub work PubSub events are not being triggered Jul 6, 2015
@nicolasiensen
Copy link
Author

Here is my hack to make it work.

josiasds referenced this issue in nossas/bonde-clients Aug 21, 2015
This is disabled for now, until we find a way to keep the user logged
in after refreshing the page.
Enabling it would force the user to log in after every refresh
(navigation works just fine, though).
@colw
Copy link

colw commented Oct 2, 2015

@nicolasiensen As an experiment, delete the pubsub-js dependency under j-toker, and install it directly into your own project.

@nicolasiensen
Copy link
Author

Hey @colw, thanks for it, but we are not using j-toker anymore.

We had to move the project to a server-side rendering architecture, and since j-toker depends on client-side objects like window it was not possible to keep using it.

@colw
Copy link

colw commented Oct 6, 2015

@nicolasiensen Cool, no worries at all.

@lynndylanhurley
Copy link
Owner

Hi guys, I'm building out an isomorphic example app using j-toker and redux. I'll post back here when it's ready to show.

@nicolasiensen
Copy link
Author

Awesome @lynndylanhurley, I'm also using redux 😃

@lynndylanhurley
Copy link
Owner

Cool, I'm thinking about releasing the redux wrapper as a separate project. I'm hoping to have it ready by the end of the week.

@lynndylanhurley
Copy link
Owner

Just a quick update, I have this working and I'm just writing the documentation. Stay tuned for a release.

@jchristianhall
Copy link

@lynndylanhurley Thanks so much for putting together a redux example! Can't wait to see it

@lynndylanhurley
Copy link
Owner

@jchristianhall - it's more than an example, it will be an entire library. I have it working and I'm just writing the tests now.

@jchristianhall
Copy link

@lynndylanhurley Excellent. Thanks!

@jchristianhall
Copy link

@lynndylanhurley Any word on when the redux library might be ready?

@lynndylanhurley
Copy link
Owner

@jchristianhall - sorry for the delay, I decided to add react-native support and it took a little longer than I thought. It should be a matter of days.

@jchristianhall
Copy link

@lynndylanhurley It's alright. Thanks for the update!

@lynndylanhurley
Copy link
Owner

@jchristianhall - the app is ready, please take a look:
https://github.com/lynndylanhurley/redux-auth

@aknott
Copy link

aknott commented Jan 27, 2016

had a similar issue here and used @nicolasiensen hack as a temp solution.

I noticed there were multiple PubSub instances and I was subscribing to an instance other than the one created within j-toker. When j-toker went to publish, that instance of PubSub had no subscribers. Potentially a side effect of webpack compilation as it appears both j-toker and pubsub-js are defining browser globals.

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

5 participants