aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2023-02-19 14:34:57 +0100
committerJoris2023-02-19 14:34:57 +0100
commit078fa790c569e4e6dbae47a2d6514995ea8d0a9a (patch)
tree7fdcbfb57a26bffb3d6d5b06f13e0a3737d2a1fa
parent46950ed9e9f513c37366347e8eb7cc5295591864 (diff)
downloadrx-078fa790c569e4e6dbae47a2d6514995ea8d0a9a.tar.gz
rx-078fa790c569e4e6dbae47a2d6514995ea8d0a9a.tar.bz2
rx-078fa790c569e4e6dbae47a2d6514995ea8d0a9a.zip
Fix readme examples
-rw-r--r--README.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index d2ab8a7..cf9db7d 100644
--- a/README.md
+++ b/README.md
@@ -42,10 +42,10 @@ mount(h('button',
Counter with `-` and `+` buttons:
```typescript
-import { h, withVar, mount } from 'rx'
+import { h, withState, mount } from 'rx'
mount(
- withVar(0, value => [
+ withState(0, value => [
value,
h('button', { onclick: () => value.update(n => n - 1) }, '-'),
h('button', { onclick: () => value.update(n => n + 1) }, '+')]))
@@ -56,10 +56,10 @@ mount(
Chronometer updating every second:
```typescript
-import { h, withVar, mount } from 'rx'
+import { h, withState, mount } from 'rx'
mount(
- withVar(0, value => {
+ withState(0, value => {
const interval = window.setInterval(() => value.update(n => n + 1), 1000)
return h('div',
{ onunmount: () => clearInterval(interval) },