0.2.3 • Published 4 years ago

@marko-tags/state v0.2.3

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Create and manipulate state directly from your templates.

Installation

npm install @marko-tags/state

Example

<state|myState = 1|>

<div>
  <div>${myState}</div>
  <button onClick(() => myState++)>Increment</button>
</div>

Real world example

<state|show = false|>

<div>
  <button onClick(() => show = !show)>Toggle</button>
  <div class=['container', {'container--visible': show}]>Content</div>
</div>

API

<state|
  stateAssignment
 |/>