fromChannelAndAncestor<D, DAncestor, P> static method
InitialData<D>
fromChannelAndAncestor<D, DAncestor, P>(
- Channel<
P> channel, - D initialValue(
- DAncestor parentData,
- P payload
Creates an InitialData that produces its initial value by calling initialValue with
a value of type DAncestor, obtained by from an ancestor state in the state tree, and the
payload value of channel.
Implementation
static InitialData<D> fromChannelAndAncestor<D, DAncestor, P>(
Channel<P> channel,
D Function(DAncestor parentData, P payload) initialValue,
) {
return InitialData._(
(ctx) => initialValue(ctx.dataValueOrThrow<DAncestor>(), ctx.payloadOrThrow<P>()),
);
}