Actually, I need to fully handle the mysite interface with json objects (React and lodash).
I get the source data through an ajax call, which we say
starred[] //returns empty array from server
and add new json when the user clicks on an asterisk,
starred.push({'id':10,'starred':1});
if user clicks asterisk again, should be 0
current_star=_findWhere(starred,{'id':10}); _.set(curren_star,'starred',0);
but when running console.log
console.log(starred); //returns [object{'id':10,'starred':0}]
but in fact, when it repeats, global json is not updated, but I perform some other operations like json,
console.log(starred); //returns [object{'id':10,'starred':1}]
How to update global, I want, as soon as I change json, it should be changed ever. Should I get the idea of ββoffering a few improved frameworks for handling json a lot easier.
Thanks before!