Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
example of how Alice and Bob can overwrite each other's data
/**
* data = {
* balance: 100,
*. addresses: ['0x1', '0x2']
* }
*/
// Alice (1)
const aliceData = await getComplexData();
// Bob (1)
const bobData = await getComplexData();
// Alice (2)
aliceData.balance = 90;
await setComplexData(aliceData);
// Bob (2)
bobData.addresses.push('0x3');
await setComplexData(bobData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment