Skip to content

ochairo/pulse

Repository files navigation

pulse logo pulse

Plain data, deeply reactive.
Explicit APIs for plain objects and arrays. No magic.

Concept

pulse is a reactive runtime for plain object and array state. It keeps reads, writes, and subscriptions explicit while preserving normal property and index navigation for reachable child nodes.

Install

pnpm add @ochairo/pulse

Quick Start

Read: Use .get() anywhere on the path.
Write: Use .set() anywhere on the path.
Subscribe: Use .on() anywhere on the path. Use .prop() To specify key names.

import { pulse } from "@ochairo/pulse";
import type { User } from "./types";

const users = pulse<User[]>([
  { name: "Mary", age: 30 },
  { name: "Chloe", age: 25 },
]);

// Subscribe to "name" mutations.
users.prop("name").on((event) =>
  console.log(event.currentValue)
);

users[0]?.name.set("Lois");

Documentation


About

Reactive runtime for data state

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors