Skip to content

Commit

Permalink
fixup: state update note
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Hibbert <[email protected]>
  • Loading branch information
dckc and Chris-Hibbert authored Feb 15, 2024
1 parent 70ceae7 commit f0d8424
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main/guides/zoe/contract-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ const RoomI = M.interface('Room', {
- Once the state is defined by the `init` function (3rd arg), properties cannot be added or removed.
- Values of state properties must be serializable.
- Values of state properties are hardened on assignment.
- You can replace the value of a state property (e.g. `state.zot = [...state.zot, 'last']`), and you can update stores (`state.players.set(1, player1)`), but you cannot do things like `state.zot.push('last')` nor `state.jot = { x: 1 };`
`state.jot.x = 2;`.
- You can replace the value of a state property (e.g. `state.zot = [...state.zot, 'last']`), and you can update stores (`state.players.set(1, player1)`), but you cannot do things like `state.zot.push('last')`, and if jot is part of state (`state.jot = { x: 1 };`), then you can't do `state.jot.x = 2;`
- The tag (1st arg) is used to form a key in `baggage`, so take care to avoid collisions. `zone.subZone()` may be used to partition namespaces.
- See also [defineExoClass](https://endojs.github.io/endo/functions/_endo_exo.defineExoClass.html) for further detail `zone.exoClass`.
- To define multiple objects that share state, use `zone.exoClassKit`.
Expand Down

0 comments on commit f0d8424

Please sign in to comment.