Simple building blocks for reliable applications
This documentation covers installation, core concepts and the full reference for the public interface.
Features
- createStore(options). Creates a store from the given options and returns an object with read and write methods.
- watchChanges(target, handler). Calls the handler every time the target changes and returns a function to stop watching.
- serializeState(state). Converts the current state to a compact string that can be restored later.
- batchUpdate(items, size). Splits a list into groups of the given size and processes them in order.
Installation
pnpm add tinyledgerQuick start
const { createStore } = require("tinyledger");
const result = createStore(data, { strict: true });
console.log(result);