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

Add extra argument to thunk middleware #69

Merged

Conversation

tonycuadra
Copy link
Contributor

@tonycuadra tonycuadra commented Mar 23, 2022

This feature is equivalent to what is available in newer versions of Redux:
https://github.com/reduxjs/redux-thunk#injecting-a-custom-argument

It allows arbitrary parameters to injected into thunks via a table passed in at Rodux initialization time (useful for passing in services or anything else we might want to mock for tests).

It can replace other custom middlewares we've written to achieve the same thing (e.g. PaginatedFetchThunk.middleware, AvatarEditorServiceThunk.middleware, RNAdapterThunk.middleware)

@coveralls
Copy link

coveralls commented Mar 23, 2022

Coverage Status

Coverage increased (+0.02%) to 99.184% when pulling 86afa18 on tonycuadra:tcuadra/thunk-middleware-extra-arg into 8aa7b32 on Roblox:master.

@github-actions
Copy link

github-actions bot commented Mar 23, 2022

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@tonycuadra
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@tonycuadra tonycuadra changed the title [wip] Add extra argument to thunk middleware Add extra argument to thunk middleware Mar 23, 2022
@tonycuadra tonycuadra marked this pull request as ready for review March 23, 2022 18:55
Copy link
Contributor

@ZoteTheMighty ZoteTheMighty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me! Could you update the docs as well? There's already info on the thunk middleware: https://roblox.github.io/rodux/api-reference/#roduxthunkmiddleware

You can label it as "unreleased" if you like, and we can change it when we cut a new version.

@tonycuadra
Copy link
Contributor Author

This looks reasonable to me! Could you update the docs as well? There's already info on the thunk middleware: https://roblox.github.io/rodux/api-reference/#roduxthunkmiddleware

You can label it as "unreleased" if you like, and we can change it when we cut a new version.

Done!

@tonycuadra
Copy link
Contributor Author

I don't have permission to do much of anything in this repo so please merge when ready @ZoteTheMighty :)

@tonycuadra
Copy link
Contributor Author

I don't have permission to do much of anything in this repo so please merge when ready @ZoteTheMighty :)

Or add more reviewers if needed (I can't do that either)

@ZoteTheMighty ZoteTheMighty merged commit 6382570 into Roblox:master Mar 24, 2022
tonycuadra added a commit to tonycuadra/rodux that referenced this pull request Nov 18, 2023
This feature is equivalent to what is available in newer versions of Redux:
https://github.com/reduxjs/redux-thunk#injecting-a-custom-argument

It allows arbitrary parameters to injected into thunks via a table passed in at Rodux initialization time (useful for passing in services or anything else we might want to mock for tests).

It can replace other custom middlewares we've written to achieve the same thing (e.g. PaginatedFetchThunk.middleware, AvatarEditorServiceThunk.middleware, RNAdapterThunk.middleware)
ZoteTheMighty pushed a commit that referenced this pull request Jan 8, 2024
* Add extra argument to thunk middleware (#69)

This feature is equivalent to what is available in newer versions of Redux:
https://github.com/reduxjs/redux-thunk#injecting-a-custom-argument

It allows arbitrary parameters to injected into thunks via a table passed in at Rodux initialization time (useful for passing in services or anything else we might want to mock for tests).

It can replace other custom middlewares we've written to achieve the same thing (e.g. PaginatedFetchThunk.middleware, AvatarEditorServiceThunk.middleware, RNAdapterThunk.middleware)

* Make it 3.2

* oops
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

Successfully merging this pull request may close these issues.

4 participants