Skip to content
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

[router-store] Missing Actions classes #44

Closed
bbaia opened this issue Jun 20, 2017 · 1 comment
Closed

[router-store] Missing Actions classes #44

bbaia opened this issue Jun 20, 2017 · 1 comment
Assignees

Comments

@bbaia
Copy link
Contributor

bbaia commented Jun 20, 2017

You should create Actions classes for router-store to avoid this kind of reducer definitions :

export function reducer(
  state: State = initialState,
  action: feature.Actions | { type: string, payload?: any },
  ) : State {
  switch (action.type) {
    case fromRouter.ROUTER_NAVIGATION: {
    }
    case feature.MY_FEATURE_ACTION: {
    }
}

(or bring back the Action interface with the payload property)

@victornoel
Copy link

Actually you can simply write:

action: feature.Actions & { payload?: any }

and it should work as expected

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

No branches or pull requests

3 participants