Skip to content
ts
import { NumberParam } from '@trail-run/core/reactive/query-params';

Function: NumberParam()

ts
function NumberParam(precision?, getDefault?): ParamConfig;

Defined in: src/reactive/query-params.ts:73

Creates a ParamConfig for numeric fields with default value checking.

Parameters

precision?

number

getDefault?

(instance) => number | undefined

Function to get the default value for comparison

Returns

ParamConfig

ParamConfig for number fields

Example

ts
@param(NumberParam(
  function(this: MyClass) { return this.defaultZoom; },
  function(this: MyClass) { return this.active; }
))
@field
zoom: number = 12;

Released under the MIT License.