Search
Loading...
Skip to content

Function: _combineProperties

function _combineProperties<T>(properties, options?): _ReadonlyReactiveProperty<T>;

Combines multiple reactive properties into a single reactive property.

Similar to combineLatest from RxJS but simpler. Emits whenever any source emits.

Type Parameters#

Type Parameter
T extends any[]

Parameters#

ParameterTypeDescription
properties{ [K in stringnumber
options?Pick<_ReactivePropertyOptions<T>, "equals">Configuration options

Returns#

_ReadonlyReactiveProperty<T>

A reactive property containing an array of values

Example#

const x = createReactiveProperty(0);
const y = createReactiveProperty(0);
const position = combineProperties([x, y]);
position.subscribe(([xVal, yVal]) => {
console.log(`Position: (${xVal}, ${yVal})`);
});