-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(signals): add skipLoadingCall to remote filter, sort and pagination
New param skipLoadingCall for filterEntities, sortEntities and loadEntitiesPage to disable auto calling set loading automatically, necesary to better control when the loading happens fix #114
- Loading branch information
1 parent
3641a04
commit 081f87d
Showing
10 changed files
with
328 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
libs/ngrx-traits/signals/src/lib/with-entities-filter/with-entities-remote-filter.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
export type EntitiesRemoteFilterMethods<Filter> = { | ||
filterEntities: ( | ||
options: | ||
| { | ||
filter: Filter; | ||
debounce?: number; | ||
patch?: false | undefined; | ||
forceLoad?: boolean; | ||
skipLoadingCall?: boolean; | ||
} | ||
| { | ||
filter: Partial<Filter>; | ||
debounce?: number; | ||
patch: true; | ||
forceLoad?: boolean; | ||
skipLoadingCall?: boolean; | ||
}, | ||
) => void; | ||
resetEntitiesFilter: (options?: { | ||
debounce?: number; | ||
forceLoad?: boolean; | ||
skipLoadingCall?: boolean; | ||
}) => void; | ||
}; | ||
export type NamedEntitiesRemoteFilterMethods< | ||
Collection extends string, | ||
Filter, | ||
> = { | ||
[K in Collection as `filter${Capitalize<string & K>}Entities`]: ( | ||
options: | ||
| { | ||
filter: Filter; | ||
debounce?: number; | ||
patch?: false | undefined; | ||
forceLoad?: boolean; | ||
skipLoadingCall?: boolean; | ||
} | ||
| { | ||
filter: Partial<Filter>; | ||
debounce?: number; | ||
patch: true; | ||
forceLoad?: boolean; | ||
skipLoadingCall?: boolean; | ||
}, | ||
) => void; | ||
} & { | ||
[K in Collection as `reset${Capitalize<string & K>}Filter`]: (options?: { | ||
debounce?: number; | ||
forceLoad?: boolean; | ||
skipLoadingCall?: boolean; | ||
}) => void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.