Page Contents
Home > @loopback/context > createViewGetter
createViewGetter() function
Create a context view as a getter with the given filter and sort matched bindings by the comparator.
Signature:
export declare function createViewGetter<T = unknown>(ctx: Context, bindingFilter: BindingFilter, bindingComparator?: BindingComparator, session?: ResolutionSession): Getter<T[]>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| ctx | Context | Context object |
| bindingFilter | BindingFilter | A function to match bindings |
| bindingComparator | BindingComparator | A function to compare two bindings |
| session | ResolutionSession | Resolution session |
Returns:
Getter<T[]>