effector / effector/patronum

Readonly create store if args is not unitable

Open
#332 1 comment 0 reactions 0 assignees View on GitHub
RFC
Dominant language
TypeScript
Stars
312
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Sometimes needed readonly store from incoming arguments outside, in factories functions for examle.
How can a solution be processed inside a function an argument that is not a unit by creating a unit from it

there is now:
```ts
const someFunction(arg1:number, arg2:string) {
const $store = readonly(createStore(arg1));
}
```

and how can it be:

```ts
const someFunction(arg1:number, arg2:string) {
const $store = readonly(arg1);
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing readonly and createStore APIs and how they handle arguments that are not units. The issue does not name a source file or test, so first locate the relevant operator implementation and tests. Done should mean a documented, tested way to create a readonly store directly from an incoming argument.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.