With that code if you ever get an empty object into the status then it will just stay there, as the new Map() code will never be executed. Perhaps you saved that at some point and then modified the code. In the editor go to the context pane on the right and delete that entry. Then try the code again.
I suspect that is a different object that you are displaying. Perhaps you have forgotten to specify the correct store when you get it elsewhere.
Yes, this is true. Before I changed that, it was perfectly fine in memory.
However, I now ended up in doing that:
var m = new Map();
m.set("A", {a: "x", b: "y"});
m.set("B", {a: "a", b: "b"});
const obj1 = Object.fromEntries(m);
global.set("Test", obj1, "persistStore");
// do some stuff
obj2 = global.get("Test", "persistStore");
var k = new Map(Object.entries(obj2));
:sigh: I wish I had time to work on stores. I think there are lots of things that could be done. I'm fairly sure it would be possible to work out a way to serialise more complex objects for example. And I'd really like to find a way to use a nosql db as a store maybe CouchDB or PouchDB for example.
Most of all, I'd like to find a way to emit events from a store so that a flow could listen for updates.
I did start to look at GunDB but it is so bizarre that I gave up.