endlich 0.1.0-beta.1 copy "endlich: ^0.1.0-beta.1" to clipboard
endlich: ^0.1.0-beta.1 copied to clipboard

unlistedoutdated

Finite State Machine

example/lib/example.dart

library example;

import 'package:freezed_annotation/freezed_annotation.dart';

import 'package:endlich/endlich.dart';

part 'example.g.dart';
part 'example.freezed.dart';

@Endlich()
@freezed
class TestState with _$TestState {
  @Endlich.initial()
  @Endlich.state(effect: 'inFoo')
  factory TestState.foo(
    int count,
    @Endlich.event(Bar) void Function(int incr) next,
  ) = Foo;

  @Endlich.state(effect: 'inBar')
  factory TestState.bar(
    int count,
    @Endlich.event(Baz) void Function(int incr) next,
  ) = Bar;

  @Endlich.state(effect: 'inBaz')
  factory TestState.baz(
    int count,
    @Endlich.event(Foo) void Function(int incr) next,
  ) = Baz;
}
0
likes
0
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

Finite State Machine

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, freezed_annotation, mobx

More

Packages that depend on endlich