Skip to content

Commit fee9632

Browse files
thetarnavgithub-actions[bot]
authored andcommitted
Format
1 parent 33db9b8 commit fee9632

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/keyed/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ The `keyArray` primitive takes 4 arguments:
4747
- `options` - a fallback for when the input list is empty or missing _(Optional)_
4848

4949
```ts
50-
const mapped = keyArray(source,
51-
(model) => model.id,
50+
const mapped = keyArray(
51+
source,
52+
model => model.id,
5253
(model, index) => {
5354
const [name, setName] = createSignal(model().name);
5455
const [description, setDescription] = createSignal(model().description);
@@ -72,7 +73,8 @@ const mapped = keyArray(source,
7273
setName,
7374
setDescription,
7475
};
75-
});
76+
},
77+
);
7678
```
7779

7880
Notice that both the value and index arguments are signals. Items are identified only by keys, it means that the items could be copied, replaced, changed, but as long as the key is the same, `keyArray` will treat it as the same item.

0 commit comments

Comments
 (0)