This one seems to be happening again.
Here’s a breakdown:
- Fetch a value for an unknown key
let res = await this.monday.storage.instance.getItem("testKey");
let storedVal = res.data.value;
console.log(storedVal);
Result:
null
matches what I expect.
- Store a value
let res = await this.monday.storage.instance.setItem("testKey", "foo");
console.log(res);
Result:
{
"method": "storage",
"data": {
"success": true
},
"requestId": "yp0v6030d"
}
I guess that means all ok.
- Retrieve the value
let res = await this.monday.storage.instance.getItem("testKey");
let storedVal = res.data.value;
console.log(storedVal);
Result:
foo
matches what I expect.
- Try to overwrite it
let storeVal = "bar";
let res = await this.monday.storage.instance.setItem("testKey", "bar");
console.log(res);
Result:
{
"method": "storage",
"data": {
"success": true
},
"requestId": "4sx2dcnz8"
}
Not really sure what that means.
- Try to fetch overwritten value.
let res = await this.monday.storage.instance.getItem("testKey");
let storedVal = res.data.value;
console.log(storedVal);
Result:
foo
I’d expected that to be bar.