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

Library limitations #67

Closed
PeterKottas opened this issue Aug 26, 2017 · 1 comment
Closed

Library limitations #67

PeterKottas opened this issue Aug 26, 2017 · 1 comment

Comments

@PeterKottas
Copy link

Hi. First of all, thanks for the effort that went into this. It's really a neatly done piece of code. Congrats!

Secondly, after using it for a little while, I seem to be starting to hit the limits of the api (maybe) and I was wondering if I am just doing something wrong, or if this is indeed not 100% suited for me.

My usecase:
I have to fire a request and then on success I have a to chain a few more requests after that. e.g. :

  1. Create a resource.
  2. On success an id is returned
  3. Use this id to perform other requests

And here's where I struggle.
Firing action in reducer is obviously an anti pattern so I can't go that way.
Chaining of actions as described in readme would work (in my setup I don't get a promise for some reason so I am only speaking theoretically). The problem with this though is I can create this resource from many places . Chaining actions in UI seems therefore a bit too repetitive for comfort.

Am I missing something or would it make more sense for me to use pure axios with some defaults set?
Main reason why I went with this lib is ease of adding authorization and very neat config on the action side. Wouldn't want to lose that but I feel like I might have hit a limitation.

Thanks for your input!

@PeterKottas
Copy link
Author

It was indeed my misunderstanding of the lib capabilities. The dispatch itself returns a promise, therefore it's easy enough to chain these inside the action creator. Check out my #68 for implementation details

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

1 participant