Reactively maps/filters items from a proxied source array or object to a new proxied array or object.
It iterates over the target proxy. For each item, it calls func.
If func returns a value, it's added to the result proxy under the same key/index.
If func returns undefined, the item is skipped (filtered out).
The returned proxy automatically updates when:
Items are added/removed/updated in the target proxy.
Any proxied data read within the func call changes (for a specific item).
Param: func
A function (value, key) => mappedValue | undefined that transforms each item.
It receives the item's value and its key/index. Return undefined to filter the item out.
Returns
A new proxied array or object containing the mapped values.
Reactively maps/filters items from a proxied source array or object to a new proxied array or object.
It iterates over the
targetproxy. For each item, it callsfunc.funcreturns a value, it's added to the result proxy under the same key/index.funcreturnsundefined, the item is skipped (filtered out).The returned proxy automatically updates when:
targetproxy.funccall changes (for a specific item).Param: func
A function
(value, key) => mappedValue | undefinedthat transforms each item. It receives the item's value and its key/index. Returnundefinedto filter the item out.Returns
A new proxied array or object containing the mapped values.
Template: IN
The type of items in the source proxy.
Template: OUT
The type of items in the resulting proxy.
Example: Map array values
Example: Filter and map object properties