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

Request for a complex real world example #39

Open
jintoppy opened this issue Apr 1, 2017 · 2 comments
Open

Request for a complex real world example #39

jintoppy opened this issue Apr 1, 2017 · 2 comments

Comments

@jintoppy
Copy link

jintoppy commented Apr 1, 2017

Hi,

I got really interested in redux-cycles. But, I am new to streams. Is it possible to add a an example project where there will be multiple async actions in a queue?

For eg. upon selecting an item from the list, a popup displayed which shows different kinds of data about the item, in which each data is the result of an async action.

Thanks much.

@jintoppy
Copy link
Author

jintoppy commented Apr 1, 2017

I have created a sample react application in redux and redux-thunk. In this application, there will be a list of users. When you click on a user, there will be one async action to get user details which contains the countryId of the user. Using that information, next async action is triggered to get all states.

How can we improve this scenario with redux-cycles?

You can see the code here and demo here.

The part in which I am really interested is given below.

let promise = this.props.getUserDetails(this.props.selectedUser.id);    
promise.then(() => {
    this.props.getStates(this.props.selectedUser.country);
});

I am not liking this way of coding, because, now there is a dependency and the order is important in this approach.

How this can be re-written using redux-cycles?

Thanks much.

@aaronmcadam
Copy link

@jintoppy I've been looking at https://github.com/cyclejs-community/awesome-cyclejs#example-applications. Did you find any complex example apps? I'm looking for one that uses HTTP progress.

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