Skip to content

Commit

Permalink
Prepare for 0.0.7 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Marner committed Jan 11, 2019
1 parent 5d13f9f commit 99b3e49
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Redux Remote Devtools

## 0.0.7

- Add support for receiving remote actions from the Devtools UI. Big thanks to @kadza for helping work through this feature

## 0.0.6

- Correctly handle the START response message
Expand Down
29 changes: 29 additions & 0 deletions README.md
Expand Up @@ -112,6 +112,35 @@ The strategy described above should work for most cases. However, if you want to

You can either write your own `toJson` methods for each of your actions and your state class. However, this quickly becomes cumbersome and error prone. Instead, the recommended way is to make use of the `json_annotation` package to automatically generate toJson functions for you.

## Dispatching Actions from DevTools

You are able to dispatch actions from the Devtools UI and have these processed by the redux implementation in your Flutter app.

In order for this to work, you need to implement an `ActionDecoder`. ActionDecoder's job is to take the JSON data received from the Devtools UI, and return an action that your reducers know how to use. For example if we dispatch an action:

```json
{
"type": "INCREMENT"
}
```

We would implement an ActionDecoder like so:

```dart
class MyDecoder extends ActionDecoder {
dynamic decode(dynamic payload) {
final map = payload as Map<String, dynamic>;
if (map['type'] == 'INCREMENT') {
return IncrementAction();
}
}
}
```

Essentially, you need to map every JSON action type into an action that can be used by your reducers.

Please get in touch if you have any awesome ideas for how to make this process smoother.

# Example Apps

This repo includes remote-devtools enabled versions of the flutter-redux example apps:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Expand Up @@ -2,7 +2,7 @@ name: redux_remote_devtools
description: Remote DevTools for Redux.dart
author: Michael Marner <michael@20papercups.net>
homepage: https://github.com/MichaelMarner/dart-redux-remote-devtools
version: 0.0.6
version: 0.0.7
dependencies:
redux: ^3.0.0
redux_dev_tools: ^0.4.0
Expand Down

0 comments on commit 99b3e49

Please sign in to comment.