Skip to content

Commit

Permalink
docs(kida): fix 'for' example
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Jan 1, 2025
1 parent 47d0121 commit 7e831cf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/kida/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ export const $admins = computed(get => get($users).filter(user => user.isAdmin))

```tsx
// components/admins.ts
import { atIndex, record } from 'kida'
import { record } from 'kida'
import { $admins } from '../stores/admins.js'

export function Admins() {
return ul()(
for$($admins)((i) => {
const $admin = record(atIndex($admins, i))

return li()($admin.name)
})
for$($admins, user => user.id)(
$admin => li()(record($admin).name)
)
)
}
```
Expand Down Expand Up @@ -110,7 +108,7 @@ $count.set($count.get() + 1)
update($count, count => count + 1)
```

To listen to changes, use the `listen` or `subscribe` function. `subscribe` will call the listener immediately.
To listen changes, use the `listen` or `subscribe` function. `subscribe` will call the listener immediately.

```ts
import { signal, subscribe } from 'kida'
Expand Down

0 comments on commit 7e831cf

Please sign in to comment.