https://github.com/plugfox/extended_bloc
A predictable state management library that helps implement the BLoC design pattern
https://github.com/plugfox/extended_bloc
Last synced: 5 months ago
JSON representation
A predictable state management library that helps implement the BLoC design pattern
- Host: GitHub
- URL: https://github.com/plugfox/extended_bloc
- Owner: PlugFox
- License: wtfpl
- Created: 2020-08-30T10:54:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-30T01:10:31.000Z (almost 5 years ago)
- Last Synced: 2025-01-31T21:34:40.120Z (about 1 year ago)
- Language: Dart
- Size: 35.2 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

# Extended [BLoC](https://pub.dev/packages/bloc)
[](https://github.com/PlugFox/extended_bloc/actions)
[](https://codecov.io/gh/PlugFox/extended_bloc)
[](https://pub.dev/packages/extended_bloc)
[](https://en.wikipedia.org/wiki/WTFPL)
[](https://github.com/tenhobi/effective_dart)
## EnumBloc
BLoC with primitive events.
Override [router] and create generators.
#### Example usage:
```dart
class MyEnumBloc extends EnumBloc {
MyEnumBloc() : super(State.initial);
@override
Map get router =>
{
Event.read : _read,
};
Stream _read() async* {
yield State.performing;
// ...
yield State.fetched;
}
}
```
## RouterBloc
BLoC with complex events, containing internal data.
Override [router] and create generators.
#### Example usage:
```dart
class MyRouterBloc extends RouterBloc {
MyRouterBloc() : super(InitialState());
@override
Map get router =>
{
PerformEvent : _perform,
};
Stream _perform(PerformEvent event) async* {
yield PerformingState();
// ...
yield PerformedState();
}
}
```
## Coverage
[](https://codecov.io/gh/PlugFox/extended_bloc/branch/master)
## Changelog
Refer to the [Changelog](https://github.com/plugfox/extended_bloc/blob/master/CHANGELOG.md) to get all release notes.
## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/PlugFox/extended_bloc/issues
## Maintainers
[Plague Fox](https://plugfox.dev)
## License
[WTFPL](https://github.com/plugfox/extended_bloc/blob/master/LICENSE)