The two files the addon reads and writes: the profiles file and the state file holding the active map.
The two files the addon reads and writes: the profiles file and the state file holding the active map.
(load-state path)Result<{:active .. :current ..}> from the state file at path.
Result<{:active .. :current ..}> from the state file at `path`.
(read-profiles path)Result<profiles-or-nil> from the EDN profiles file at path.
Result<profiles-or-nil> from the EDN profiles file at `path`.
(save-state! path st)Write st to path through a sibling temp file and an atomic move.
Result<path>.
Write `st` to `path` through a sibling temp file and an atomic move. Result<path>.
(sync-state! path base state)Merge the live state with the file at path and write the merge.
state is the live atom, base an atom holding what this instance last
read or wrote. What the file gained since base lands in state too, so a
second instance sharing the file (a hot remount) keeps its writes and so do
we. An unreadable file counts as unchanged since base, so it is
overwritten as before. Locked per path within the JVM. Result<merged>.
Merge the live state with the file at `path` and write the merge. `state` is the live atom, `base` an atom holding what this instance last read or wrote. What the file gained since `base` lands in `state` too, so a second instance sharing the file (a hot remount) keeps its writes and so do we. An unreadable file counts as unchanged since `base`, so it is overwritten as before. Locked per path within the JVM. Result<merged>.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |