What is the current behavior:
Currently typeguards in match field are not working in split
Following code
const $s = createStore<string | null>(null)
const valid = createEvent<string>()
const clk = createEvent()
split({
source: $s,
clock: clk,
match: {
valid: (str: string | null): str is string => Boolean(str),
},
cases: {
valid,
}
})
gives type error like { error: "source type should extends cases"; sourceType: string | null; caseType: string; }
It can be workarounded by using other overload, where split actually creates events based on match typings
const $s = createStore<string | null>(null);
const valid = createEvent<string>();
const clk = createEvent();
const { validCase } = split(
sample({ source: $s, clock: clk }),
{
validCase: (str: string | null): str is string =>
Boolean(str),
}
);
sample({
clock: validCase,
target: valid,
});
Please provide the steps to reproduce and if possible a minimal demo of the problem via https://share.effector.dev, https://codesandbox.io or similar
What is the expected behavior:
- Typeguards in
match of config form of split are working
Which versions of effector packages, and which browser and OS are affected by this issue? Did this work in previous versions of effector?:
current latest release of effector@22
What is the current behavior:
Currently typeguards in
matchfield are not working in splitFollowing code
gives type error like
{ error: "source type should extends cases"; sourceType: string | null; caseType: string; }It can be workarounded by using other overload, where
splitactually creates events based onmatchtypingsPlease provide the steps to reproduce and if possible a minimal demo of the problem via https://share.effector.dev, https://codesandbox.io or similar
What is the expected behavior:
matchof config form ofsplitare workingWhich versions of effector packages, and which browser and OS are affected by this issue? Did this work in previous versions of effector?:
current latest release of
effector@22