# inertial

> A tiny library for integrating reactive signals anywhere.

Latest version **0.5.0** (published 2024-09-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install inertial
pnpm add inertial
yarn add inertial
bun add inertial
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2024-09-17 |
| First published | 2023-10-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Oleksii Raspopov |
| Maintainers | alexeyraspopov |

## Links

- npm: https://www.npmjs.com/package/inertial
- Repository: https://github.com/UnknownPrinciple/inertial
- Homepage: https://unknownprinciple.github.io/inertial/
- Issues: https://github.com/UnknownPrinciple/inertial/issues
- npm.io page: https://npm.io/package/inertial

## Recent versions

- 0.5.0 (latest) — 2024-09-17
- 0.4.1 — 2024-09-16
- 0.4.0 — 2024-09-16
- 0.3.0 — 2024-09-14
- 0.2.2 — 2024-08-09
- 0.2.1 — 2024-07-04
- 0.2.0 — 2024-07-04
- 0.1.1 — 2024-07-02
- 0.1.0 — 2024-06-12
- 0.0.0 — 2023-10-13

## README

# inertial

    npm install inertial

A tiny library for integrating reactive signals anywhere.

- Zero dependencies & tiny bundle (around 700B min+gzip)
- Predictable memory management & lowest CPU overhead
- TypeScript typings & inline hints included

```js
import { ObservableScope } from "inertial";

/* Create isolated scope that has its own lifecycle */
let os = ObservableScope();

/* Use signals to define values and relations between them */
let counter = os.signal(0);
let doubled = os.derive(() => counter() * 2);

/* Use watchers to track value changes and perform side effects */
let output = document.getElementById("output");
os.watch(() => {
  output.innerText = doubled();
});

/* Trigger value updates that will ensure all relations updated as well */
let trigger = document.getElementById("trigger");
trigger.addEventListener("click", () => {
  counter((value) => value + 1);
});
```

Read [full docs](https://unknownprinciple.github.io/inertial/) on the website.

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