Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Passing dispatch instead of calling it. #309

Closed
arthwood opened this issue Feb 2, 2021 · 0 comments
Closed

Passing dispatch instead of calling it. #309

arthwood opened this issue Feb 2, 2021 · 0 comments

Comments

@arthwood
Copy link

arthwood commented Feb 2, 2021

Question

I couldn't find satisfying answer anywhere but:

I have two thunks A and B.
From A I'm dispatching B.
If B doesn't use getState is there any fundamental difference or downside of passing dispatch from A to B (B(dispatch)), rather than passing B to dispatch of A (dispatch(B))?
Just wondering, as it makes FP composition easier:

// explicit call
const A = dispatch => dispatch(B)

vs

// implicitly passing dispatch
const A = B
@timdorr timdorr closed this as completed Feb 2, 2021
@reduxjs reduxjs locked and limited conversation to collaborators Feb 2, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants