Skip to content

Commit

Permalink
Update README, update changelog for version 2.1.0 (#28)
Browse files Browse the repository at this point in the history
* Add readme section on custom key-value stores

* Bump to 2.1.0, update CHANGELOG.md

* Update README.md

Co-authored-by: Illia Romanenko <[email protected]>

* Use consistent naming in README

Co-authored-by: Illia Romanenko <[email protected]>
  • Loading branch information
solid-yuriiprykhodko and Illia Romanenko authored Aug 26, 2021
1 parent b31e6df commit 70ee530
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.1.0

- Add support for a generic `KeyValueStore` interface.
- Add an extensive unit-test suite.

## 2.0.1

- Restore `BehaviorSubject` behavior of `HydratedSubject`.
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,33 @@ We also support serialized classes with `hydrate` and `persist` arguments.
```dart
final user$ = HydratedSubject<User>(
"user",
hydrate: (String s) => User.fromJSON(s),
persist: (User user) => user.toJSON(),
hydrate: (String s) => User.fromJson(s),
persist: (User user) => user.toJson(),
);
```

## Reliable

Hydrated is mock tested with all supported types and is dogfooded by its creator.

## Extensible

Hydrated supports any key-value data storages -- just implement the `KeyValueStore` interface
and you will be able to use *hive*, *flutter_secure_storage* or any other persistence solution of your choice.

```dart
class MyAwesomeKeyValueStore implements KeyValueStore {
/// your implementation here...
}
final user = HydratedSubject<User>(
"user",
hydrate: (String s) => User.fromJson(s),
persist: (User user) => user.toJson(),
keyValueStore: MyAwesomeKeyValueStore()
);
```

## Demo

<img alt="demo of Hydrated BehaviorSubject between app restarts" src="https://raw.githubusercontent.com/lukepighetti/hydrated/master/doc/hydrated.gif" width="400">
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: hydrated
description: An automatically persisted BehaviorSubject with simple hydration for Flutter. Intended to be used with the BLoC pattern.
version: 2.0.1
version: 2.1.0
homepage: https://github.com/solid-software/hydrated

environment:
Expand Down

0 comments on commit 70ee530

Please sign in to comment.