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

Incorrect typings for GroupByFunction #220

Closed
gaopinghuang0 opened this issue Jan 21, 2019 · 2 comments
Closed

Incorrect typings for GroupByFunction #220

gaopinghuang0 opened this issue Jan 21, 2019 · 2 comments

Comments

@gaopinghuang0
Copy link
Contributor

The typings for GroupByFunction are as below.

  type GroupByActionTypes = (actions: string | string[]) => GroupByFunction;
  export type GroupByFunction = <State>(action: Action, currentState: State, previousHistory: StateWithHistory<State>) => any;

However, GroupByActionTypes is actually returning an arrow function accepting only one action.

export function groupByActionTypes (rawActions) {
  const actions = parseActions(rawActions)
  return (action) => actions.indexOf(action.type) >= 0 ? action.type : null
}

So I think the typing would be something like below.

  export type GroupByFunction = (action: Action) => any;
@louisrli
Copy link

+1: I'm also finding some misc typing issues here

@nmay231
Copy link
Collaborator

nmay231 commented Dec 18, 2019

Resolved in #248 👍

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