updateParentData<P> method

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

Implementation

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