@roomservice/core
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

Core

This is the core logic for the browser, react, and node clients.

Interpretters

The Core exposes "interpreters" that are responsible for maintaining an object's state through commands.

Example: MapInterpreter

import { MapInterpreter } from '@roomservice/core';

// ~~ Create a new list! ~~
const {
  // The `mcreate` command responsible for creating this list
  cmd,
  // An in-memory representation of the list
  store,
  // Metadata associated with the list
  meta,
} = MapInterpreter.newList('doc', 'map');

// Apply incoming commands
MapInterpreter.applyCommand(store, ['mput', 'doc', 'map', 'key', 'value']);

// Run functions and get the resulting commands
const cmd = MapInterpreter.runSet(store, meta, 'dogs', 'cats');

Readme

Keywords

none

Package Sidebar

Install

npm i @roomservice/core

Weekly Downloads

18

Version

0.3.2

License

MIT

Unpacked Size

232 kB

Total Files

33

Last publish

Collaborators

  • flaque
  • kcking