nimahkh / soft_bun

A lightweight and framework-agnostic reactivity system implemented in TypeScript
Other
10 stars 1 forks source link

Nested Object #25

Closed Mostafa-Mohammadi closed 1 year ago

Mostafa-Mohammadi commented 1 year ago

After revising various test cases, it has come to my attention that our current implementation does not support the addition of reactivity for nested objects.

For instance:

const data = {a: 1, b: 2, c: {d: 2, e: 3}};
const state = new State(data);
state.reactive('c.d', '$c.e + $a');
expect(state.state.c.d).to.equal(4);

In this specific scenario, the property 'd' remains unchanged at a value of 2.

I would like to inquire whether there are any plans to address this issue. Alternatively, I am open to submitting a pull request to contribute to its resolution.

nimahkh commented 1 year ago

Good one Mostafa, I would appreciate if you could share your solution.

nimahkh commented 1 year ago

The issue has been solved https://github.com/nimahkh/soft_bun/pull/27

soft_bun (1.7.4)