JSPM

ngrx-dictionary-reducer

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q25480F
  • License ISC

Create a reducer that sorts by property from an existing reducer

Package Exports

  • ngrx-dictionary-reducer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngrx-dictionary-reducer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

This package allows you to create a reducer that sorts elements by property (string or number). There are a few implementation details you have to do to get it to work; first, you have to use the helper classes provided in your reducers to make it work.

These are:

ChildSingleAction

For when you want to create, put, update or delete a single object.

ChildManyAction

For when you want to create, put, update or delete many objects.

ChildClearAction

Use this to define an action that will clear the store.

For your delete requests, you need to pass the whole object you are trying to delete, and not just the id, because it uses the properties on the object to sort them. It filters events based on the selector function you provide. I use it most often to fitler for parent foriegn keys from data recieved from a database.