An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

![](https://raw.githubusercontent.com/felangel/bloc/master/docs/assets/bloc_logo_full.png)


# Extended [BLoC](https://pub.dev/packages/bloc)
[![Actions Status](https://github.com/PlugFox/extended_bloc/workflows/extended_bloc/badge.svg)](https://github.com/PlugFox/extended_bloc/actions)
[![Coverage](https://codecov.io/gh/PlugFox/extended_bloc/branch/master/graph/badge.svg)](https://codecov.io/gh/PlugFox/extended_bloc)
[![Pub](https://img.shields.io/pub/v/extended_bloc.svg)](https://pub.dev/packages/extended_bloc)
[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](https://en.wikipedia.org/wiki/WTFPL)
[![effective_dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](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/dev/graphs/sunburst.svg)](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)