Skip to main content
Module

x/nano_jsx/index.ts>Store

🎯 SSR first, lightweight 1kB JSX library.
Latest
class Store
import { Store } from "https://deno.land/x/nano_jsx@v0.1.0/index.ts";

Constructors

new
Store(
defaultState: Object,
name?: string,
storage?: "memory" | "local" | "session",
)

Create your own Store.

Type Parameters

optional
S = any

Properties

private
_id: string
private
_listeners: Map<string, Function>
private
_prevState: S
private
_state: S
private
_storage: "memory" | "local" | "session"
state: S

Methods

private
persist(newState: S)

Clears the state of the whole store.

setState(newState: S)
use()