WikiPadDocument

WikiPadDocument (Model)

  • WikiPadDocument (value-struct) FileDocument
    • TextStoreMemory (value-struct) Codeable, TextStoreProtocol
    • HypertextEditorState (reference-class) ObservableObject

Design

  • Model is refactored as value type, down to the storage. Change to value triggers save.
  • Document (WikiPadDocument) implements FileDocument protocol.
  • Mutating operations (intents) implemented as extension: add, delete, rename, back and forward.
  • Mutating sub operations also implemented as extensions: setStartTitle, checkRename.
  • Store (TextStoreMemory) uses access protocol, implemented as dictionary and mutating functions.
  • State (HypertextEditorState) for selection, browser and title index is still a reference type. Added to view environment. Part of document, but not persistent.
Advertisement