From 078fa790c569e4e6dbae47a2d6514995ea8d0a9a Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 19 Feb 2023 14:34:57 +0100 Subject: Fix readme examples --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.md') 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) }, -- cgit v1.2.3