Maybe update docs
Open
Nobody has claimed this yet.
question
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 881
- PR merge metrics
- No merged PRs in 30d
Description
🙋♂ Question
const a = { id: 1 };
const b = { id: 2, children: [a] };
const objs = { 1: a, 2: b };
const fn = produce((draft) => {
draft[2].children[0].x = 1;
});
const r = fn(objs);
console.log(r[1]); // {id:1}
console.log(r[2].children[0]); //{id:1, x:1}
In two places of objs we have two pointers to the same object a but when we change it in one place we treat it like two different objects.
I expected that to be
console.log(r[1]); // {id:1, x:1}
console.log(r[2].children[0]); //{id:1, x:1}
I didn't find anything about that in docs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No documentation file or test is named. Start by reproducing the supplied JavaScript example with Immer's produce entry point, then inspect the existing documentation for shared references and draft behavior; done means the relevant documentation clearly explains the observed result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100