effector
effector copied to clipboard
allow useStoreMap for shapes
Proposal
const value = useStoreMap({
shape: { a: $a, b: $b, c: $c }, // ! now param name is "store", proposal - rename to "shape" or "units"
keys,
fn
});
- maybe rename this method to
useShapeMaporuseUnitMapоruseUnitMemo?
Use case
now, we need a combined store for this cases: // model.ts
import { combine } from "effector";
export const $combined = combine({ a: $a, b: $b, c: $c })
// Component.tsx
import {$combined} from "./model.ts";
...
const value = useStoreMap({
store: $combined,
keys,
fn
});
I suppose we don't need to rename the whole hook:
const value = useStoreMap({
source: { a: $a, b: $b, c: $c }, // Just rename the parameter. Or don't rename anything
keys,
fn
});