diff options
author | Joris | 2023-02-19 14:34:57 +0100 |
---|---|---|
committer | Joris | 2023-02-19 14:34:57 +0100 |
commit | 078fa790c569e4e6dbae47a2d6514995ea8d0a9a (patch) | |
tree | 7fdcbfb57a26bffb3d6d5b06f13e0a3737d2a1fa | |
parent | 46950ed9e9f513c37366347e8eb7cc5295591864 (diff) |
Fix readme examples
-rw-r--r-- | README.md | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) }, |