aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-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) },