eventuous_generator 0.0.1-prerelease copy "eventuous_generator: ^0.0.1-prerelease" to clipboard
eventuous_generator: ^0.0.1-prerelease copied to clipboard

outdated

Code generator for Eventuous - a lightweight and open-souce Event Sourcing library for Dart.

example/lib/example.dart

import 'package:eventuous/eventuous.dart';
import 'package:json_annotation/json_annotation.dart';

part 'example.g.dart';
part 'example.eventuous.dart';

@AggregateType(
  id: ExampleId1,
  event: JsonObject,
  state: ExampleState1,
  value: ExampleStateModel1,
)
class Example extends _$Example {
  Example(ExampleId1 id, [ExampleState1? state]) : super(id, state);
}

class ExampleId1 extends AggregateId {
  ExampleId1(String id) : super(id);
}

@AggregateValueType(Example, data: JsonMap)
class ExampleStateModel1 extends _$ExampleStateModel1 {
  ExampleStateModel1() : super([]);

  @override
  JsonMap toJson() {
    // TODO: implement toJson
    throw UnimplementedError();
  }
}

@AggregateStateType(Example, value: ExampleStateModel1)
class ExampleState1 extends _$ExampleState1 {
  ExampleState1([ExampleStateModel1? value, int? version])
      : super(value, version);
}

@JsonSerializable()
@AggregateEventType(Example)
class ExampleCreated extends _$ExampleCreated {
  ExampleCreated() : super([]);
}
0
likes
0
pub points
0%
popularity

Publisher

verified publisherdiscoos.org

Code generator for Eventuous - a lightweight and open-souce Event Sourcing library for Dart.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, eventuous, source_gen

More

Packages that depend on eventuous_generator