UNPKG

@loopback/docs

Version:
37 lines (24 loc) 1.33 kB
--- lang: en title: 'API docs: context.sortbindingsbyphase' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar editurl: https://github.com/strongloop/loopback-next/tree/master/packages/context permalink: /doc/en/lb4/apidocs.context.sortbindingsbyphase.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [sortBindingsByPhase](./context.sortbindingsbyphase.md) ## sortBindingsByPhase() function Sort bindings by phase names denoted by a tag and the predefined order <b>Signature:</b> ```typescript export declare function sortBindingsByPhase<T = unknown>(bindings: Readonly<Binding<T>>[], phaseTagName?: string, orderOfPhases?: (string | symbol)[]): Readonly<Binding<T>>[]; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | bindings | <code>Readonly&lt;Binding&lt;T&gt;&gt;[]</code> | An array of bindings | | phaseTagName | <code>string</code> | Tag name for phase, for example, we can use the value <code>'a'</code> of tag <code>order</code> as the phase name for <code>binding.tag({order: 'a'})</code>. | | orderOfPhases | <code>(string &#124; symbol)[]</code> | An array of phase names as the predefined order | <b>Returns:</b> `Readonly<Binding<T>>[]`