mirror of
https://github.com/littensy/charm.git
synced 2026-10-23 05:46:27 +00:00
docs: reformat api reference
This commit is contained in:
parent
5be8e27296
commit
fe55171432
1 changed files with 19 additions and 17 deletions
36
README.md
36
README.md
|
|
@ -45,39 +45,41 @@ Add `littensy/charm` to your `wally.toml` file.
|
||||||
Charm = "littensy/charm@VERSION"
|
Charm = "littensy/charm@VERSION"
|
||||||
```
|
```
|
||||||
|
|
||||||
## 📚 Documentation
|
## 📚 API Reference
|
||||||
|
|
||||||
### `atom(state)`
|
### Charm
|
||||||
|
|
||||||
### `derive(atom, comparator?)`
|
#### `atom(state)`
|
||||||
|
|
||||||
### `subscribe(atom, listener)`
|
#### `effect(callback)`
|
||||||
|
|
||||||
### `effect(callback)`
|
#### `subscribe(atom, listener)`
|
||||||
|
|
||||||
### `observe(atom, observer)`
|
#### `derive(atom, comparator?)`
|
||||||
|
|
||||||
### `mapAtom(atom, mapper)`
|
#### `observe(atom, observer)`
|
||||||
|
|
||||||
## 📚 React API
|
#### `mapAtom(atom, mapper)`
|
||||||
|
|
||||||
### `useAtom(atom, selector?)`
|
### React
|
||||||
|
|
||||||
### `useAtomState(atom)`
|
#### `useAtom(atom, selector?)`
|
||||||
|
|
||||||
### `useSetAtom(atom)`
|
#### `useAtomState(atom)`
|
||||||
|
|
||||||
## 📚 Sync API
|
#### `useSetAtom(atom)`
|
||||||
|
|
||||||
### `sync.client(options)`
|
### Sync
|
||||||
|
|
||||||
### `sync.server(options)`
|
#### `sync.client(options)`
|
||||||
|
|
||||||
### `Client.sync(payload)`
|
#### `Client.sync(payload)`
|
||||||
|
|
||||||
### `Server.onSync(callback)`
|
#### `sync.server(options)`
|
||||||
|
|
||||||
### `Server.hydrate(player)`
|
#### `Server.onSync(callback)`
|
||||||
|
|
||||||
|
#### `Server.hydrate(player)`
|
||||||
|
|
||||||
## 🚀 Examples
|
## 🚀 Examples
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue