map
Reactive helper that runs a callback only on new or modified entries. The problem of doing {array.map(item => <li>{item}</li>)}is that is doesnt react when the array is modified (items added/modified/deleted), as that would require to recreate the whole array. For this reason map exists.
# Arguments
name | type | description |
---|---|---|
items | signal/iterable object | a signal whose value is iterable |
callback | fn | callback to run on each item |
# map test
Modifying an array and getting reactive changes
# map types
map works with Array, Set and Map