module@warp-drive/experiments/storage @experimental
Function NumberParam()
ts
function NumberParam(precision?, getDefault?): ParamConfig;Defined in: storage/query-params.ts:65
Creates a ParamConfig for numeric fields with default value checking.
Parameters
precision?
number
When given, the number of digits to serialize after the decimal point
getDefault?
(instance) => number | undefined
Function to get the default value for comparison
Returns
ParamConfig for number fields
Example
ts
@param(NumberParam(2, function (instance: MyClass) { return instance.defaultZoom; }))
@field
zoom: number = 12;