set method

  1. @override
Future<String> set(
  1. String topic,
  2. String message
)
override

Implementation

@override
Future<String> set(String topic, String message) async {
  _isInitialized();
  final hash = await hashMessage(message);
  final msgs = messages[topic] ?? {};
  if (messages[hash] != null) {
    return hash;
  }
  msgs[hash] = message;
  messages[topic] = msgs;
  await _persist();
  return hash;
}