agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications
https://agile-ts.org
MIT License
95 stars 8 forks source link

Modify Item trough Selector #93

Closed bennobuilder closed 3 years ago

bennobuilder commented 3 years ago

It would be pretty cool if we could modify the selected Item of the Selector through the Selector.

MY_COLLECTION.collect({id: 1, name: 'hans'})
const MY_SELECTOR = MY_COLLECTION.createSelector("mySelector", 1);
MY_SELECTOR.patch({name: 'frank'});
MY_COLLECTION.getItemValue(1); // Returns' {id: 1, name: 'hans'}' but it would be cool if the value is now '{id: 1, name: 'frank'}'