Skip to content

Commit

Permalink
feat(Entity): Add 'selectId' and 'sortComparer' to state adapter (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRyanDev authored and brandonroberts committed Mar 4, 2018
1 parent 51a1547 commit 69a62f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/entity/src/create_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export function createEntityAdapter<T>(
: createUnsortedStateAdapter(selectId);

return {
selectId,
sortComparer,
...stateFactory,
...selectorsFactory,
...stateAdapter,
Expand Down
2 changes: 2 additions & 0 deletions modules/entity/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export type EntitySelectors<T, V> = {
};

export interface EntityAdapter<T> extends EntityStateAdapter<T> {
selectId: IdSelector<T>;
sortComparer: false | Comparer<T>;
getInitialState(): EntityState<T>;
getInitialState<S extends object>(state: S): EntityState<T> & S;
getSelectors(): EntitySelectors<T, EntityState<T>>;
Expand Down

0 comments on commit 69a62f2

Please sign in to comment.