Skip to content

Function: compositeProvider() ​

ts
function compositeProvider(name, providers): ConfigProvider;

Defined in: providers/composite.ts:23

Create a provider that combines other providers into one provider.

Parameters ​

ParameterTypeDescription
namestringThe provider name.
providersreadonly ConfigProvider[]The child providers, from low to high precedence.

Returns ​

ConfigProvider

A provider that can load and, as the children permit, save and subscribe.

Remarks ​

load merges the child documents in order, section by section and field by field. A later child overrides an earlier child. load rejects only when all children reject. save sends the document to each child that can save.

Example ​

ts
compositeProvider('remote', [
  httpProvider({ url: '/defaults.json' }),
  httpProvider({ url: '/api/wand', save: 'PUT' }),
]);