Skip to content

Commit 99b3e49

Browse files
author
Michael Marner
committed
Prepare for 0.0.7 release
1 parent 5d13f9f commit 99b3e49

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Redux Remote Devtools
22

3+
## 0.0.7
4+
5+
- Add support for receiving remote actions from the Devtools UI. Big thanks to @kadza for helping work through this feature
6+
37
## 0.0.6
48

59
- Correctly handle the START response message

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,35 @@ The strategy described above should work for most cases. However, if you want to
112112

113113
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.
114114

115+
## Dispatching Actions from DevTools
116+
117+
You are able to dispatch actions from the Devtools UI and have these processed by the redux implementation in your Flutter app.
118+
119+
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:
120+
121+
```json
122+
{
123+
"type": "INCREMENT"
124+
}
125+
```
126+
127+
We would implement an ActionDecoder like so:
128+
129+
```dart
130+
class MyDecoder extends ActionDecoder {
131+
dynamic decode(dynamic payload) {
132+
final map = payload as Map<String, dynamic>;
133+
if (map['type'] == 'INCREMENT') {
134+
return IncrementAction();
135+
}
136+
}
137+
}
138+
```
139+
140+
Essentially, you need to map every JSON action type into an action that can be used by your reducers.
141+
142+
Please get in touch if you have any awesome ideas for how to make this process smoother.
143+
115144
# Example Apps
116145

117146
This repo includes remote-devtools enabled versions of the flutter-redux example apps:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: redux_remote_devtools
22
description: Remote DevTools for Redux.dart
33
author: Michael Marner <michael@20papercups.net>
44
homepage: https://github.com/MichaelMarner/dart-redux-remote-devtools
5-
version: 0.0.6
5+
version: 0.0.7
66
dependencies:
77
redux: ^3.0.0
88
redux_dev_tools: ^0.4.0

0 commit comments

Comments
 (0)