Is there a need for an AlwaysPipe?
sclassen opened this issue · comments
Similar to the AlwaysCallback this would allow to pipe both resolve and rejection in a single implementation.
I would propose the following API:
public interface AlwaysCallback<D, F, D_OUT, F_OUT, P_OUT> {
Promise<D_OUT, F_OUT, P_OUT> pipeAlways(final State state, final D resolved, final F rejected);
}
I see that this is only a convenience method as the same behaviour can be achieved with a DonePipe and a FailPipe.
Do we really need P_OUT
given that progress remains unchanged?
yes in the pipe interface you need it. In the method on the promise interface you do not need it.
<D_OUT, F_OUT> Promise<D_OUT, F_OUT, P> always(AlwaysPipe<D, F, D_OUT, F_OUT, P> alwaysPipe);