What is the current behavior:
There exact sample from https://effector.dev/docs/api/effector/attach, but with one change - when calling createEffect I added type for effect argument:
const original = createEffect<string, void>(params => {
console.log('Original effect called with', params);
});
const data =createStore(8900);
const created = attach({
effect: original,
source: data,
mapParams: (params, data) => {
console.log('Created effect called with', params, 'and data', data);
return {wrapped: params, data};
},
});
TypeScript 3.8.0 compailns with error:
No overload matches this call.
The last overload gave the following error.
Argument of type '{ effect: Effect<string, void, Error>; source: Store<number>; mapParams: (params: unknown, data: number) => { wrapped: unknown; data: number; }; }' is not assignable to parameter of type '{ effect: Effect<string, void, Error>; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ effect: Effect<string, void, Error>; }'.
Which versions of effector packages, and which browser and OS are affected by this issue? Did this work in previous versions of effector?:
"effector": "^21.7.5",
TypeScript 3.8.0
Maybe the last TypeScript will be ok, can't check right now.
What is the current behavior:
There exact sample from https://effector.dev/docs/api/effector/attach, but with one change - when calling createEffect I added type for effect argument:
TypeScript 3.8.0 compailns with error:
Which versions of effector packages, and which browser and OS are affected by this issue? Did this work in previous versions of effector?:
"effector": "^21.7.5",
TypeScript 3.8.0
Maybe the last TypeScript will be ok, can't check right now.