example of how Alice and Bob can overwrite each other's data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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