Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Add generic for store state type #267

Conversation

SanterreJo
Copy link
Contributor

What:

Fixes #265
As suggested by @robertgr991
Use type inference benefits when using a function like rehydrated

Why:

When implementing a function like rehydrated the store argument is currently typed as any.

How:

By adding a generic type when calling the createPersistedState function

const persisted = createPersistedState<RootState>();

Checklist:

  • Documentation N/A
  • Tests N/A
  • Ready to be merged
  • Added myself to contributors table

@robinvdvleuten
Copy link
Owner

@SanterreJo thanks for the effort!

@robinvdvleuten
Copy link
Owner

@all-contributors please add @SanterreJo for code

@allcontributors
Copy link
Contributor

@robinvdvleuten

I've put up a pull request to add @SanterreJo! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript: "rehydrated" method, "store" parameter possible wrong type annotation
2 participants