trphoenix
2018-10-30 f2dafcc61407aef960ee17b576794b1260e84a08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
part of redux_remote_devtools;
 
/// Interface for custom State encoding logic
abstract class StateEncoder {
  const StateEncoder();
 
  // Converts a State instance into a string suitable for sending to devtools
  String encode(dynamic state);
}
 
/// A State encoder that converts a state instances to stringified JSON
class JsonStateEncoder extends StateEncoder {
  const JsonStateEncoder() : super();
 
  /// Encodes a state instance as stringified JSON
  String encode(dynamic state) {
    return jsonEncode(state);
  }
}