updateData method

_MessageActionWithData<M, D> updateData(
  1. D update(
    1. MessageContext msgCtx,
    2. M msg,
    3. D current
    ), {
  2. String? label,
})

Implementation

_MessageActionWithData<M, D> updateData(
  D Function(MessageContext msgCtx, M msg, D current) update, {
  String? label,
}) {
  return _MessageActionWithData<M, D>._(
    _ActionType.updateData,
    (msgCtx, msg, d) {
      msgCtx.dataOrThrow<D>().update((d) => update(msgCtx, msg, d));
    },
    null,
    label,
  );
}