-
Notifications
You must be signed in to change notification settings - Fork 60
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
Typescript support for Redux4 #100
Conversation
@@ -1,11 +1,12 @@ | |||
import * as tt from 'typescript-definition-tester' | |||
|
|||
describe('TypeScript definitions', function () { | |||
this.timeout(4000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why, but some times compiler waist much time to process the whole test.
a3 :createReducer<number>({ [act1.getType()]: () => 1 }, 0), | ||
a4 :createReducer<boolean>(onOff, true), | ||
a5 :createReducer<number>(onOff, 1) | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the advantage of combining rather than just creating them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a way to know about Reducer type compatibility between redux-act and redux Reducer type
interface Reducer<S> { | ||
(state: S, action: Redux.AnyAction): S | ||
interface Reducer<S, A extends Redux.Action = Redux.AnyAction> { | ||
(state: S | undefined, action: A): S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would the state
be undefined
in the reduce function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for compatibility with redux Reducer type
It was updated on this PR: reduxjs/redux#2563
Just for Closes #99