Currently the key option for the importing of the plugin only allows for State Tokens and strings. This causes an error (#123) if you pass in a StateModel.
It should be fairly easy to suppose a StateModel object since it has a name attribute which is the value that needs to be examined rather than the key itself.
for (const key of keys) {
let val = nextState;
if (key !== '@@STATE') {
val = getValue(nextState, key);
}
try {
this._asyncEngine.setItem(key, options.serialize(val));
}
catch (e) {
console.error('Error ocurred while serializing the store value, value not updated.');
}
}
Just check to see if the key is a StateModel and if it is, the "real name" is key.name rather than key.
Currently the
keyoption for the importing of the plugin only allows for State Tokens and strings. This causes an error (#123) if you pass in aStateModel.It should be fairly easy to suppose a
StateModelobject since it has anameattribute which is the value that needs to be examined rather than thekeyitself.Just check to see if the key is a
StateModeland if it is, the "real name" iskey.namerather thankey.