0.1.15 • Published 12 months ago

value-notifier-ts v0.1.15

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

value-notifier-ts

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

Example

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>;
}
0.1.15

12 months ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago