From e0699eed72c5682bd2395ba4299ff69933c83d48 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 19 Feb 2023 14:39:02 +0100 Subject: Be more precise configuring chords --- src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.ts') 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({ -- cgit v1.2.3