Skip to content

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

Merged

Conversation

SethDavenport
Copy link
Member

Fixes #216

@SethDavenport
Copy link
Member Author

Ping :)

a global 'AppState' by composing the reducer types:

```typescript
export interface IAppState {
Copy link
Member

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.

Copy link
Member Author

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 {
Copy link
Member

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.

Copy link
Member Author

@SethDavenport SethDavenport Sep 19, 2016

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

see angular-redux/tassign

@SethDavenport
Copy link
Member Author

@bennett000 just pointed out Typescript 2's readonly. Seems very useful... I want to play with it and see if it can improve things even more.

@SethDavenport SethDavenport merged commit 91c5eec into angular-redux:master Nov 7, 2016
@SethDavenport SethDavenport deleted the docs/typed-reducers branch November 7, 2016 03:17
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.

3 participants