zustand 0.0.1 copy "zustand: ^0.0.1" to clipboard
zustand: ^0.0.1 copied to clipboard

A package that brings Zustand-like state management in your dart app.

example/zustand_example.dart

import 'package:zustand/zustand.dart';

class CounterStore extends Store<int> {
  CounterStore() : super(0);

  void increment() => set(state + 1);
  void reset() => set(0);
}

CounterStore useCounterStore() => create(() => CounterStore());

Future<void> main() async {
  final counter = useCounterStore();

  counter.stream.listen((state) {
    print('Counter: $state');
  });

  counter.increment();
  counter.increment();
  counter.reset();

  await StoreLocator().dispose();
}
5
likes
0
points
62
downloads

Publisher

verified publisherjosiahsaunders.com

Weekly Downloads

A package that brings Zustand-like state management in your dart app.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on zustand