-
Notifications
You must be signed in to change notification settings - Fork 202
Added tassign, docs about typing reducers #221
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
Added tassign, docs about typing reducers #221
Conversation
ad2b723
to
ad020a9
Compare
493e7d0
to
65230d3
Compare
Ping :) |
a global 'AppState' by composing the reducer types: | ||
|
||
```typescript | ||
export interface IAppState { |
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 about:
export interface IAppState {
foo?: TFoo;
bar?: IBar;
}
So you're able to provide an empty object when configuring the store. I pretty much do it this way all the time.
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.
Yes good point.
@@ -0,0 +1,3 @@ | |||
export function tassign<T extends U, U>(target: T, ...source: U[]): T { |
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.
Thoughts on making tassign
it's own NPM package? can see this being useful outside of ng2-redux
.
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.
Makes sense.
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.
see angular-redux/tassign
@bennett000 just pointed out Typescript 2's |
65230d3
to
7f8859c
Compare
7f8859c
to
5fd09fb
Compare
5fd09fb
to
e93949d
Compare
Fixes #216