# @toolkip/model

> model utility functions

Latest version **2.5.0** (published 2020-12-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @toolkip/model
pnpm add @toolkip/model
yarn add @toolkip/model
bun add @toolkip/model
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.0 |
| Published | 2020-12-25 |
| First published | 2020-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 92.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kip Price |
| Maintainers | kip_price |

## Links

- npm: https://www.npmjs.com/package/@toolkip/model
- npm.io page: https://npm.io/package/@toolkip/model

## Dependencies (10)

- [@toolkip/async](https://npm.io/package/@toolkip/async.md) ^2.0.0
- [@toolkip/history](https://npm.io/package/@toolkip/history.md) ^2.5.0
- [@toolkip/structs](https://npm.io/package/@toolkip/structs.md) ^1.0.10
- [@toolkip/managers](https://npm.io/package/@toolkip/managers.md) ^2.5.0
- [@toolkip/code-event](https://npm.io/package/@toolkip/code-event.md) ^2.0.0
- [@toolkip/comparable](https://npm.io/package/@toolkip/comparable.md) ^2.2.3
- [@toolkip/identifiable](https://npm.io/package/@toolkip/identifiable.md) ^2.5.0
- [@toolkip/shared-types](https://npm.io/package/@toolkip/shared-types.md) ^2.2.3
- [@toolkip/object-helpers](https://npm.io/package/@toolkip/object-helpers.md) ^2.5.0
- [@toolkip/primitive-helpers](https://npm.io/package/@toolkip/primitive-helpers.md) ^2.5.0

## Recent versions

- 2.5.0 (latest) — 2020-12-25
- 2.4.0 — 2020-07-25
- 2.3.6 — 2020-07-22
- 2.3.4 — 2020-07-14
- 2.3.0 — 2020-07-04
- 2.2.8 — 2020-06-03
- 2.2.5 — 2020-06-01
- 2.2.4 — 2020-05-31
- 2.2.3 — 2020-05-31
- 2.2.0 — 2020-05-28
- 2.1.1 — 2020-05-26
- 2.1.0 — 2020-05-26
- 2.0.0 — 2020-05-26
- 1.1.0 — 2020-05-12
- 1.0.10 — 2020-05-08
- … 3 more at https://npm.io/package/@toolkip/model/versions

## README

# Toolkip: Models

The model library in `toolkip` is designed to manage state effectively in an immutable and bindable way. When instantiating a model you will be able to define a set of values that the particular library can contain

## _Model
This is the core set of shared functionality between models. All models contain their data within an `_innerModel` property, all models allow for event listening at any of the global, model, or property levels, and all models keep track of their internal history so that undoing or redoing is atraightforward.

This layer also introduces the expected functions that all other models will enable: the getters and setters 

### Handling imports & exports
Models are specifically designed to aid in client-server translation of objects. As such, a model may specify a set of transformations that should be applied to data in order to get it server-ready, or to import. 

### Passing models around
Everything inside of a model should also be a model. 

Example:

|-------------------| 
| _ImmutableModel   |
| ----------------- |
| - _innerModel: ImmutableModel<T>
| ----------------- |
| + get             |
| + set             |
|-------------------|


--------
Model<T>
--------
- _innerModel: ImmutableModel<T>
- _history: HistoryChain<T>
- _event: ModelEvent<T>
--------
+ addEventListeners: () => void
+ import(data: T): void;
+ export(): T;

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