diff --git a/readme.md b/readme.md index ad3555d..6aca917 100644 --- a/readme.md +++ b/readme.md @@ -11,19 +11,26 @@ import { signal, wire } from 'haptic/state'; import { when } from 'haptic/stdlib'; const state = signal({ + text: '', count: 0, - countNext: wire($ => state.count($) + 1), }); const Page = () =>
You've typed {wire($ => state.text().length)} characters
+ data.text(ev.currentTarget.value)} + /> -Content below changes when state.count > 5
After {wire($ => 5 - state.count($))} clicks the content will change
{when(wire($ => state.count($) > 5 ? "T" : "F"), { - T: () =>There have been more than 5 clicks
, - F: () =>Current click count is {wire(state.count)}
, + T: () => There are over 5 clicks!, + F: () =>Clicks: {wire(state.count)}
, })}