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

Side effects within calmm-js #2

Open
aksonov opened this issue May 17, 2016 · 3 comments
Open

Side effects within calmm-js #2

aksonov opened this issue May 17, 2016 · 3 comments

Comments

@aksonov
Copy link

aksonov commented May 17, 2016

I've asked this question within Gitter, maybe it will be useful to add more documentation about it:

Hi! I'm new in FRP world and just found your library. I'm building chat-based app and trying to make my xmpp work in FRP fashion - trying to migrate from redux where i have already too much boilerplate. In redux i have action creator that call xmpp connect function and then change state within xmpp reducer. Now i want to implement the same using Calmm. I've read https://github.com/calmm-js/documentation/blob/master/redux-vs-calmm.md but it seems not have "howto" about doing things "right" in Calmm, but just comparison. I've checked TodoMVC example, but it doesn't look very clear.

In other words how to do properly side effects using Calmm?

@aksonov
Copy link
Author

aksonov commented May 17, 2016

Sorry, i still doesn't see what is best place to put side effects and how to pass it to React - i didn't found any example with side effect, could you provide some examples with fetch or other side effect?

@polytypic
Copy link
Member

FYI, I'm currently a little bit too busy at work to write examples. I'll try to find some time to write a simple example ASAP, but don't hold your breath. :)

@aksonov
Copy link
Author

aksonov commented May 19, 2016

ok :)
Alteast could I ask some questions about side effects here?
For example i need to load user profile after login. Could Profile data be an atom? I need to persist it (including sessionID) to local storage (to avoid login each app run), but also this data should be updated properly after each user login.

So from one side it should be atom (so user may modify it), but from other side it should be updated when user does re-login (i.e. "computed" value)

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