spec<K, V> static method

HandlerSpec<CRDTORMapHandler<K, V>> spec<K, V>(
  1. String type, {
  2. ValueCodec<K>? keyCodec,
  3. ValueCodec<V>? valueCodec,
})

The kind this handler is, under type.

Only the tag is asked for: the class knows the rest.

Pass it wherever a kind is named: BaseCRDTDocument.register, BaseCRDTDocument.handler, and a container's child and insertChild.

Implementation

static HandlerSpec<CRDTORMapHandler<K, V>> spec<K, V>(
  String type, {
  ValueCodec<K>? keyCodec,
  ValueCodec<V>? valueCodec,
}) =>
    HandlerSpec<CRDTORMapHandler<K, V>>(
      type,
      (doc, id) => CRDTORMapHandler<K, V>(
        doc,
        id,
        handlerType: type,
        keyCodec: keyCodec,
        valueCodec: valueCodec,
      ),
      formats: _formats,
    );