Skip to main content

Create truly reactive values which you can connect anywhere such as in the DOM.

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.0.0)

dynamic/core

The core piece to enabling truly reactive values without overhead or compilation.

The premise is really simple, you wrap a value which other logic needs to react to in dynamic(value) and others will know when it changed. The main application currently is in the module @dynamic/html which enables a reactive DOM.

Use

const example = dynamic('');
example.listen(next => console.log("Value:", next));
example.value = 'hello'; // Logs "Value: hello"

const exclaimed = example.derive(next => next + "!");
exclaimed.listen(next => console.log("Exclaimed:", next));
example.value += ' world'; // Logs "Value: hello world" and "Exclaimed: hello world!"
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @dynamic/core

Import symbol

import * as mod from "@dynamic/core";

Add Package

npx jsr add @dynamic/core

Import symbol

import * as mod from "@dynamic/core";

Add Package

yarn dlx jsr add @dynamic/core

Import symbol

import * as mod from "@dynamic/core";

Add Package

pnpm dlx jsr add @dynamic/core

Import symbol

import * as mod from "@dynamic/core";

Add Package

bunx jsr add @dynamic/core

Import symbol

import * as mod from "@dynamic/core";