@marko-tags/state

0.2.3 • Public • Published


@marko-tags/state
API Stability NPM Version Downloads

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
 |/>

Readme

Keywords

Package Sidebar

Install

npm i @marko-tags/state

Weekly Downloads

0

Version

0.2.3

License

MIT

Unpacked Size

9.92 kB

Total Files

8

Last publish

Collaborators

  • tigt
  • ryanturnquist
  • dylanpiercey
  • ryansolid
  • mlrawlings
  • agliga