Skip to content
On this page

Sourced

Almost all of config's fields can be written in many ways:

Plain value

It will be passed as is.

It should be used when the value of the field cannot change during application lifecycle.

Store with a value

It resolves to the current value that will be passed.

It should be used when the value of the field can change independently. For example, if you want to pass userId to some field, it is good idea to pass it as a Store because userId can change after login/logout and these processes do not affect a Query directly.

Function (params) => value

It is called with parameter of the Query, returned value will be passed to the request as query parameters.

It is a good way to formulate some field based on Query parameters.

{ source: Store, fn: (params, source) => value }

In this case fn will be called with parameter of the Query and current value of the source Store, returned value will be passed

It combines a way to formulate field based on Query parameters and based on external Store. So, you can use both data sources to define the final field value.

Released under the MIT License.