Joseph Testa
Tera Contributor

Hi Tomasz, I'm not looking for a component as much as a way to save several state parameters within a JSON object. On a complex page there can be a lot of state parameters and it would help to organize them by using objects to combine related parameters. I found that doing something like this seems to work but I don't know why it works or if it is correct practice. My current solution below seems like the object's variable needs to be set twice for it to actually take the value.

 

var tempObject = api.state.myObject;
tempObject.default_search_criteria = "test123";
api.setState('myObject.default_search_criteria', "test123");