CAN state store¶
Backlinks¶
- The CAN store's current scratchfile address field holds the address of everything above-the-fold in the scratchfile
- The CAN state-store currentscratchfileaddress field holds the last-updated address of everything above the fold in the scratchfile
- CAN should have a single state store
- So CAN's handlers can access application state when needed, CAN should have a state store. The state store sdould listen to events to update its state when needed, and should allow read-only queries of its state.
- CAN's store should listen to NOTE_EXISTENCE
- When CAN's state store detects a NOTE_EXISTENCE event it should update the currentscratchfilenew field if the event address matches address of currentscratchfileaddress. The CAN store's currentscratchfilenew field holds if the current scratchfile exists in the notebook.
- CAN's store should listen to SCRATCHFILE_ADDRESSED
- When CAN's state store detects a SCRATCHFILE_ADDRESSED event, it should update the currentscratchfileaddress field. The CAN store's currentscratchfileaddress field holds the address of everything above-the-fold in the scratchfile