-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return Store
and StoreWritable<T>
whenever it is meaningful
#275
Comments
now this code const { $part1, $part2 } = reshape({
source: $complexData,
shape: {
$part1: (complexData) => complexData.part1,
$part2: (complexData) => complexData.part2
}
}) is the same as this code const $part1 = $complexData.map(complexData => complexData.part1)
const $part2 = $complexData.map(complexData => complexData.part2) I think it would be really useful if reshape returned a simple store, changing which would cause the parent store changes. |
@agadoev At the moment effector has no defined https://github.com/effector/effector/blob/master/packages/effector/index.d.ts It will be possible only after this change. |
reshape
return value to DerivedStore
DerivedStore
whenever it is meaningful
DerivedStore
whenever it is meaningfulReadonlyStore
whenever it is meaningful
ReadonlyStore
whenever it is meaningfulStore
and StoreWritable<T>
whenever it is meaningful
|
Now in the documentation and
reshape
function signature return value isStore
, but in fact it isReadonlyStore
. It can be reproduced by decomposing some stores with reshape and trying to modify it with.on()
. An error message will appear in the browser console.I suggest explicitly defining ReadonlyStore type as the return value of reshape function.
The text was updated successfully, but these errors were encountered: