Skip to content

Consider adding types and logic for handling normalized state #333

@markerikson

Description

@markerikson

Given that we recommend normalizing state, it would be nice to have at least some amount of built-in tooling to help with that. This was also on Dan's wishlist of things to include in a Redux addon layer:

  • Containing built-in helpers for indexing, normalization, collections, and optimistic updates.

I previously asked on Twitter about the idea of adding something like this:

https://twitter.com/acemarke/status/1216766299688316928

The NgRX platform has a library called @ngrx/entity ( https://ngrx.io/guide/entity ), which contains some type definitions and helpers for working with normalized state. Per discussion with an NgRX dev, that library is already almost completely framework-agnostic - it just has a couple NgRX/Angular-specific imports.

I just opened up ngrx/platform#2333 to ask if they might be able to tweak it and make it truly agnostic, in which case we might be able to depend on @ngrx/entity ourselves.

Alternately, we could copy-paste the code with attribution.

There's also a bunch of other libraries for dealing with entity management, which I have listed at https://github.com/markerikson/redux-ecosystem-links/blob/master/entity-collection-management.md .

Key considerations:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions