-
Notifications
You must be signed in to change notification settings - Fork 294
Add handleAction example with a reducer function to README #205
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
Conversation
|
What do you think about pulling an example from the tests? https://github.com/acdlite/redux-actions/blob/master/src/__tests__/handleAction-test.js I believe most of the examples in the README are in this format. Thanks for your time! |
|
Ok! I updated the example with one that was in the test. |
|
Can you include the expectations in the test? |
|
I didn't get it, what kind of expectations you mean? |
|
expect (...).to.equal(...)
On Tue, Mar 21, 2017 at 4:00 PM Leonardo Luiz ***@***.***> wrote:
I didn't get it, what kind of expectations you mean?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#205 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACmkd1cmiIq53EbU_0tIxtdYzhUE-hlgks5roFaIgaJpZM4MjSEH>
.
--
Victor Alvarez
|
|
There are similar expectations in the test, like the one bellow. it('accepts action function as action type', () => {
const incrementAction = createAction(type);
const reducer = handleAction(incrementAction, (state, action) => ({
counter: state.counter + action.payload
}), defaultState);
expect(reducer(prevState, incrementAction(7)))
.to.deep.equal({
counter: 10
});
}); |
|
@leonardokl Will you please make new commit to resolve conflict |
|
I can just resolve them from here. |
|
Hmm the README changed significantly since this PR was opened. I recommend closing this pr since the underlying issue that it fixes is also fixed in #222. |
Fixes #204