# value-notifier-ts

> A simple primitive for listening to changes to a value

Latest version **0.1.15** (published 2023-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install value-notifier-ts
pnpm add value-notifier-ts
yarn add value-notifier-ts
bun add value-notifier-ts
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.15 |
| Published | 2023-05-15 |
| First published | 2022-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tim Smart |
| Maintainers | tim-smart |

## Links

- npm: https://www.npmjs.com/package/value-notifier-ts
- Repository: https://github.com/tim-smart/value-notifier-ts
- npm.io page: https://npm.io/package/value-notifier-ts

## Recent versions

- 0.1.15 (latest) — 2023-05-15
- 0.1.14 — 2022-09-22
- 0.1.13 — 2022-09-22
- 0.1.12 — 2022-09-22
- 0.1.11 — 2022-09-22
- 0.1.10 — 2022-09-22
- 0.1.9 — 2022-09-22
- 0.1.8 — 2022-09-22
- 0.1.7 — 2022-09-21
- 0.1.6 — 2022-09-21
- 0.1.5 — 2022-09-21
- 0.1.4 — 2022-09-21
- 0.1.3 — 2022-09-21
- 0.1.2 — 2022-09-21
- 0.1.1 — 2022-09-21
- … 1 more at https://npm.io/package/value-notifier-ts/versions

## README

# value-notifier-ts

Inspired by `ValueNotifer` from Flutter, `valueNotifer` is a simple way of
listening to changes and updating a value.

## Example

```typescript
import { valueNotifer } from "value-notifier-ts";
import { useValueListenable } from "value-notifier-ts/react";

const counter = valueNotifer(0);

export function CounterText() {
  const count = useValueListenable(counter);
  return <div>Current count: {count}</div>;
}

export function CounterButton() {
  const increment = () => counter.update((count) => count + 1);

  return <button onClick={increment}>Increment</button>;
}
```

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