Page Contents

Home > @loopback/context > sortBindingsByPhase

sortBindingsByPhase() function

Sort bindings by phase names denoted by a tag and the predefined order

Signature:

export declare function sortBindingsByPhase(bindings: Readonly<Binding<unknown>>[], phaseTagName?: string, orderOfPhases?: (string | symbol)[]): Readonly<Binding<unknown>>[];

Parameters

Parameter Type Description
bindings Readonly<Binding<unknown>>[] An array of bindings
phaseTagName string Tag name for phase, for example, we can use the value 'a' of tag order as the phase name for binding.tag({order: 'a'}).
orderOfPhases (string | symbol)[] An array of phase names as the predefined order

Returns:

Readonly<Binding<unknown>>[]