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

We have to check docs #23

Open
kuraga opened this issue Apr 27, 2015 · 7 comments
Open

We have to check docs #23

kuraga opened this issue Apr 27, 2015 · 7 comments

Comments

@kuraga
Copy link
Contributor

kuraga commented Apr 27, 2015

We have to check if every API method is mentioned in docs.

@kuraga kuraga closed this as completed Apr 27, 2015
@kuraga kuraga changed the title About set method We have to check docs Apr 27, 2015
@kuraga kuraga reopened this Apr 27, 2015
@Tjorriemorrie
Copy link

Is emit still valid?
TypeError: freezer.emit is not a function

@arqex
Copy link
Owner

arqex commented Jun 21, 2017

Hey @Tjorriemorrie

emit is now the way of trigger events. trigger is deprecated. If you are seeing that message is either because you are using an old version of freezer, or you are not initalizating the store properly

This should work:

import Freezer from 'freezer-js';
var freezer = new Freezer({});
freezer.emit('my:event');

@Tjorriemorrie
Copy link

Thanks, I was stuck on 0.11 for some reason. This is such a great library.

@arqex
Copy link
Owner

arqex commented Jun 22, 2017

I am glad you liked it :) I am preparing a little a article with freezer patterns to celebrate the 1000 stars, keep tuned!

@arqex
Copy link
Owner

arqex commented Jun 22, 2017

In fact! Here it is the article draft. If you want to preview and share your thoughts I'll be so grateful:
https://medium.com/@arqex/7-tips-using-react-with-freezer-f4d75e363b94

@Tjorriemorrie
Copy link

Tjorriemorrie commented Jun 23, 2017

It's a good article. Maybe touch on how redux selectors are similarly handled. And also when freezer.on is added to the component, does it create a listener? Meaning do I have to unset the listener/something when the component unmounts (or only specifically when freezer's addListener was used)?

@arqex
Copy link
Owner

arqex commented Jun 23, 2017

By selector you mean this?
https://github.com/reactjs/reselect

It's great, I had never heard of them and I think it's possible to use them with freezer out of the box.

Good appreciation on stop listening events on components that are using freezer.on. In the article I suggest to only have one listener at the top component of your React tree. In my case that component is never unmounted so I will never need to stop listening. It's cool, one thing less I need to care about.

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

3 participants