Skip to content

Commit a94fa53

Browse files
committed
docs(kida): fix 'for' example
1 parent 47d0121 commit a94fa53

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/kida/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,14 @@ export const $admins = computed(get => get($users).filter(user => user.isAdmin))
5353

5454
```tsx
5555
// components/admins.ts
56-
import { atIndex, record } from 'kida'
56+
import { record } from 'kida'
5757
import { $admins } from '../stores/admins.js'
5858

5959
export function Admins() {
6060
return ul()(
61-
for$($admins)((i) => {
62-
const $admin = record(atIndex($admins, i))
63-
64-
return li()($admin.name)
65-
})
61+
for$($admins, user => user.id)(
62+
$admin => li()(record($admin).name)
63+
)
6664
)
6765
}
6866
```

0 commit comments

Comments
 (0)