anchor

@anchorlib/core

Reactive State Management for JavaScript with a focus on simplicity and developer experience.

Features

Installation

npm install @anchorlib/core

Documentation

For full documentation, visit Anchor Core Documentation

Quick Start

import { anchor, derive } from '@anchorlib/core';

// Create a reactive state object
const state = anchor({
  count: 0,
  user: {
    name: 'John Doe',
    email: 'john@example.com',
  },
});

// Subscribe to state changes
const unsubscribe = derive(state, (snapshot, event) => {
  console.log('State changed:', snapshot, event);
});

// Mutate state directly
state.count++;
state.user.name = 'Jane Doe';

// Unsubscribe when needed
// unsubscribe();

License

MIT