# @roomservice/core

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

Latest version **0.3.2** (published 2020-12-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @roomservice/core
pnpm add @roomservice/core
yarn add @roomservice/core
bun add @roomservice/core
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2020-12-29 |
| First published | 2020-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 226.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Flaque |
| Maintainers | flaque, kcking |

## Links

- npm: https://www.npmjs.com/package/@roomservice/core
- npm.io page: https://npm.io/package/@roomservice/core

## Dependencies (1)

- [tiny-invariant](https://npm.io/package/tiny-invariant.md) ^1.1.0

## Recent versions

- 0.3.2 (latest) — 2020-12-29
- 0.3.3-0 (next) — 2021-01-21
- 0.3.1 — 2020-12-11
- 0.2.1 — 2020-12-01
- 0.2.1-0 — 2020-11-25
- 0.2.0 — 2020-11-13
- 0.1.0 — 2020-11-13

## README

# 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

```ts
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');
```

---
_Source: https://npm.io/package/@roomservice/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
