aboutsummaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.ts')
-rw-r--r--src/main.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.ts b/src/main.ts
index bba799e..e588aab 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,4 +1,4 @@
-import { h, withVar, mount } from 'lib/rx'
+import { h, withState, mount } from 'lib/rx'
import * as Form from 'view/form'
import * as Play from 'view/play'
import * as Options from 'view/options'
@@ -9,9 +9,9 @@ enum Page {
}
mount(
- withVar(Page.Form, (page, updatePage) => [
+ withState(Page.Form, page => [
h('header',
- { onclick: () => updatePage(_ => Page.Form) },
+ { onclick: () => page.update(_ => Page.Form) },
'Chords'
),
page.map(p =>
@@ -20,7 +20,7 @@ mount(
options: Options.load(),
onSubmit: (options: Options.Model) => {
Options.save(options)
- updatePage(_ => Page.Play)
+ page.update(_ => Page.Play)
}
})
: Play.view({