-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
const { d1, d2 } = yield* all({
d1: call(fetchD1, options),
d2: call(fetchD2, options),
});
I've had sitatuions where the above example fetchD1
and fetchD2
are both other sagas that I am calling with call
but fetchD1
infers the correct type ({ from: string; to: string; featureName: string | undefined; name: string; data: MeasurementCharacteristicPresentation[]; }
) and fetchD2
infers,
Generator<SelectEffect | AllEffect<SagaGenerator<{
from: string;
to: string;
featureName: string | undefined;
name: string;
data: MeasurementCharacteristicPresentation[];
}, CallEffect<...>>>
The difference between the two sagas return,
fetchD1
return yield* call(
(from, to, take, machineId) =>
client.fetchD1Data.unique({
query: {
from,
to,
take,
machineId
}
}).promise,
from,
to,
constants.maxTake,
machineId
);
fetchD2
return yield* all(
items.map(({ name }) =>
call(fetchD2Data, { from, to, name })
)
);
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed