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

Typing initialActions function #161

Open
gayratv opened this issue Oct 18, 2020 · 0 comments
Open

Typing initialActions function #161

gayratv opened this issue Oct 18, 2020 · 0 comments

Comments

@gayratv
Copy link

gayratv commented Oct 18, 2020

I wrote a small tutorial project (project is working)
https://github.com/Ulibka68/otus_react_dz/tree/Les23/7-try-to-type

Inside project I'm write getModule function exactly as widget example:
link

I'm type my function using this type:

export function getCahnelsWindowModule(): ISagaModule<typeof reducer> {
....
initialActions: [startWindowSaga()],
}

function startWindowSaga(): ThunkAction< void,  LifeGameRootState,  unknown,  Action<string>> {
  return (dispatch, getState) => {
    dispatch(cnahelWindow_START_SAGA());
  };
}

But return type of startWindowSaga function is not compatible with AnyAction type and I must wrote huge patch.
What's the normal way for typing initialActions functions ?

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

1 participant