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?: ResolutionOptionsOrSession): Getter<T[]>;

Parameters

Parameter Type Description
ctx Context Context object
bindingFilter BindingFilter A function to match bindings
bindingComparator BindingComparator (Optional) A function to compare two bindings
session ResolutionOptionsOrSession (Optional) Resolution session

Returns:

Getter<T[]>