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

Export ActionCreators type to allow re-exporting generated actionCreators #42

Open
FrozenKiwi opened this issue Oct 23, 2019 · 1 comment

Comments

@FrozenKiwi
Copy link

FrozenKiwi commented Oct 23, 2019

I'm creating a library to allow shimming my redux store with test data, but while keeping the interfaces/actions generated by immer-reducer, combined with TS project references.

I use the compiler switch "declarations" so we generate .d.ts files, however with this switch we get compiler errors on our exported reducer functions

export const uploadReducer = createReducerFunction(UploadReducer, initialState);

Exported variable 'A' has or is using name 'ImmerReducerFunction' from external module ".../immer-reducer/lib/immer-reducer" but cannot be named.

From googling, it appears that because this type isn't exported from immer-reducer, TS seems to not be able to generate the .d.ts files describing it.

Current workaround is to set reducers to type "any", which isn't a big deal but sub-optimal

export const uploadReducer: any = createReducerFunction(UploadReducer, initialState);

@hcharley
Copy link
Contributor

hcharley commented Dec 9, 2019

I ran into this as well.

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

2 participants