-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add type parameter for Id in createEntityAdapter #2099
Add type parameter for Id in createEntityAdapter #2099
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0e79626:
|
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
I've gone over this - from my side it's okay @markerikson . |
Do I need to do anything to update the docs- I think currently they have still have the old types. Also is there any point keeping the DictionaryNum type around still? |
@@ -24,7 +24,7 @@ export type Dictionary<T, Id extends EntityId> = Partial<Record<Id, T>> | |||
/** | |||
* @public | |||
*/ | |||
export type DictionaryNum<T> = Dictionary<TemplateStringsArray, number> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that with this PR, this type could be pretty much completely removed - or only be kept for backwards compat, but not really referenced any more/
Yeah, docs PRs would be great where you see them necessary 👍 |
I think I've updated the docs where it's needed - it should be ready to go |
…d-in-createEntityAdapter
Hiya. I'm looking at this, and it seems like it makes some decidedly breaking changes to the types: it looks like we have to pass Given that, I don't think we can ship this in a 1.x release, unless I'm missing something. Also, I'm realllly not sure about this line: export type Dictionary<T, Id extends EntityId> = Partial<Record<Id, T>> That looks funky to me |
I would agree this is probably a breaking change - although I think it will be 'worth it' when you come to a 2.0 release, since it's solved a real problem on a medium to large codebase I've been working on. Ideally I would say swap the order of Id and T (and do the same on all types) but this would make it 'more breaking' - is this the issue you have with the dictionary type? |
@markerikson Just seen this pr was closed - is this not something you want to change anymore? I'm happy to put the work in to update it if we're coming up to a 2.0 release? |
I think this was just an accident. But funny enough, I don't have permissions to reopen ^^ |
Uh. Yeah, I don't have permission to reopen it either! I think the issue is it was targeted to the @Matt-Ord guess create a new PR? Go ahead and target |
Fixes issue #2098
Let me know if this change also needs any docs/ I've messed up the system for creating a PR