@nkeff/cardboard-js
    Preparing search index...

    Function state

    • state creates a reactive value that can the be used with tags to create dinamic and reactive apps.

      Type Parameters

      • T

      Parameters

      • initialValue: T

      Returns State<T>

      const count = state(0);
      count.changed(() => { ... });
      count.dispatch(2);
      count.value++;

      div().hideIf(count);
      div().disableIf(count);
      div(template('Count is: $count', { count: count }));