Skip to content

Why is CreateLogic.Config.Transform.Hook uses optional argument for reject? #150

Open
@chenxinyanc

Description

@chenxinyanc

When compiling with tsc and --strict switched on, I found error in createLogic callback. Specifically, tsc indicates reject parameter in transform function can be undefined. I checked the type definition:

/* ----- transform ----- */
interface Transform<
State,
Action extends ActionBasis,
Dependency extends object,
Context extends Object
> {
transform?: Transform.Hook<State, Action, Dependency, Context>;
}
export namespace Transform {
export type Hook<
State,
Action extends ActionBasis,
Dependency extends object,
Context extends Object = undefined
> = (
depObj: DepObj<State, Action, Dependency>,
next: Pass<Action, Context>,
reject?: Pass<Action, Context>
) => void;
}
// ---------------------------------------- //

It used reject?: Pass<Action, Context> for transform function signature. I wonder, is there any case where transform can be called with reject neglected? I've checked #124 and #125, but still couldn't figure out why there is ? following reject parameter.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions