create method

Future create(
  1. String thing,
  2. Map<String, dynamic> data
)

Creates a record in the database.

Implementation

Future<dynamic> create(String thing, Map<String, dynamic> data) {
  final id = _generateId();
  final completer = Completer();
  wait().then((_) {
    once(id, (res) => _output(res, 'create', thing, completer));
    _send(id, 'create', [thing, data]);
  });
  return completer.future;
}