effector / effector/effector

allow useStoreMap for shapes

Open
#864 1 comment 0 reactions 0 assignees View on GitHub
RFC
Dominant language
TypeScript
Stars
4.9k
Forks
280
Avg merge
2d 6h
Merged PRs (30d)
7

Description

## Proposal
```typescript
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 `useShapeMap` or `useUnitMap` оr `useUnitMemo` ?

## Use case
now, we need a combined store for this cases:
// model.ts
```typescript
import { combine } from "effector";

export const $combined = combine({ a: $a, b: $b, c: $c })
```

// Component.tsx
```typescript
import {$combined} from "./model.ts";

...
const value = useStoreMap({
store: $combined,
keys,
fn
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.