Issue while updating view Model using setter method
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
Example Code
// STORE
class Todo {
@observable title = "Test";
@action.bound
setTitle(value: string) {
this.title = value;
}
}
// CREATE VIEW MODEL
const model = new Todo();
const viewModel = createViewModel(model);
viewModel.setTitle("Updated Test")
console.log(viewModel.title) // Updated Test
console.log(model.title) // Updated Test
Here when we console the original model we expected title value as "Test" only but actual output is "Updated Test"
package versions:
"mobx": "5.15.0",
"mobx-react": "6.1.4",
"mobx-utils": "5.6.2",
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
Reproduce the example with the listed mobx, mobx-react, and mobx-utils versions, then start at the createViewModel entry point. Verify how calling the setter affects the view model and original model; done means the view model shows the updated title while the original remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100