Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Pass saga args through to subspaced sagas #63

Merged
merged 2 commits into from
Jan 12, 2018

Conversation

mpeyper
Copy link
Contributor

@mpeyper mpeyper commented Jan 12, 2018

redux-saga supports passing arguments to sagas when running them. Although createSagaMiddleware does pass the args on when to the underlying run call, the subspaced and provideStore higher-order sagas would not pass them through to the sagas they were wrapping.

@@ -43,113 +43,9 @@ describe('integration tests', () => {
}
}

it('should transfer context to subspaced saga', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only moved the context tests down the file.

})
})

it('should pass args through to subspaced saga', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where the new tests for passing args start

const provideStore = (store, options) => (saga) => {
return function* () {
yield setContext({ store })
yield setContext({ sagaMiddlewareOptions: options })
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no reason to make seperate calls to setContext here.

@jpeyper
Copy link
Collaborator

jpeyper commented Jan 12, 2018

Looks good to me :)

@jpeyper jpeyper merged commit ada1120 into ioof-holdings:master Jan 12, 2018
@mpeyper mpeyper deleted the saga-improvements branch January 18, 2018 11:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants