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

Doesn't seem like the REQUEST action is ever sent in api.js #4

Open
purcebr opened this issue Jan 27, 2016 · 3 comments
Open

Doesn't seem like the REQUEST action is ever sent in api.js #4

purcebr opened this issue Jan 27, 2016 · 3 comments

Comments

@purcebr
Copy link

purcebr commented Jan 27, 2016

Hi!

Thanks for the great demo! I'm curious as to requestType never appears to be used (on line 74) of api. Shouldn't an "I'm fetching" action be called for the get quotes action? it looks like it's only fired for the login sequence.

thanks
@purcebr

@chenkie
Copy link
Contributor

chenkie commented Jan 27, 2016

Thanks!

It was more just for brevity in the article that goes along with the demo, but you're right, you'd want to use the requestType for fetching indication :)

@purcebr
Copy link
Author

purcebr commented Jan 27, 2016

Ah, ok -

Curious, where would that occur? it seems like there's either an error or success that comes out of the api middleware, but I'm confused as to where that "is fetching" action might be dispatched.

thanks!

@chenkie
Copy link
Contributor

chenkie commented Jan 27, 2016

You can actually just call next with it in the api middleware. So just above the return callApi...

next({type: requestType})

Then you can pick it up in your App.js container, just like how isAuthenticated is and you can use it to display a spinner if you like.

Let me know if that works for you :)

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