Manage states for your atoms. (Easy undo/redo)
Manage states for your atoms. (Easy undo/redo)
The great library... store your stuff here.
The great library... store your stuff here.
(can-undo?)
Do we have enough history to undo?
Do we have enough history to undo?
(different-from? new old)
Check if any non-passive snapshot is different.
Check if any non-passive snapshot is different.
What will happen in the future...
What will happen in the future...
(off-the-record & content)
(off-the-record &form &env & content)
Temporarily deactivate the watches write to history.
Temporarily deactivate the watches write to history.
(overwrite-record!)
(overwrite-record! snaps)
Overwrite the last historic entry with a new one.
Overwrite the last historic entry with a new one.
(record! atm k)
(record! atm k passive?)
Add the atom to the overseer watch. When any of the atom under its watch is modified, it triggers a save of every atom to history (if any of the atom is different form the last historic state). Return the atom.
If `passive?' is true, the atom will NOT trigger any new save and will only be saved when another atom under watch is modified.
Add the atom to the overseer watch. When any of the atom under its watch is modified, it triggers a save of every atom to history (if any of the atom is different form the last historic state). Return the atom. If `passive?' is true, the atom will NOT trigger any new save and will only be saved when another atom under watch is modified.
(replace-library! new-atom)
The library atom (where all records are kept to enable 'undo') will be replaced by the new-atom. Useful if you've already done some modifications to the new-atom (like added some watchers). Depending on where you use this function, you might want to fire a `trigger-record!' just after.
Usually, one would also want to use `replace-prophecy!' in order to replace the 'redo' atom.
The library atom (where all records are kept to enable 'undo') will be replaced by the new-atom. Useful if you've already done some modifications to the new-atom (like added some watchers). Depending on where you use this function, you might want to fire a `trigger-record!' just after. Usually, one would also want to use `replace-prophecy!' in order to replace the 'redo' atom.
(replace-prophecy! new-atom)
The prophecy atom (where all records are kept to enable 'redo') will be replaced by the new-atom. Useful if you've already done some modifications to the new-atom (like added some watchers).
Usually used with `replace-library'.
The prophecy atom (where all records are kept to enable 'redo') will be replaced by the new-atom. Useful if you've already done some modifications to the new-atom (like added some watchers). Usually used with `replace-library'.
(stop-all-records!)
Remove all the atoms from the overseer watch. The atoms will no longer be watched, nor any of their state saved to history.
Remove all the atoms from the overseer watch. The atoms will no longer be watched, nor any of their state saved to history.
(stop-record! k)
Remove the atom associated to this key from the overseer watch. This atom will no longer be watched, nor its state saved to history.
Remove the atom associated to this key from the overseer watch. This atom will no longer be watched, nor its state saved to history.
(trigger-record!)
Trigger a record to history. The current state of at least one atom must be different from the previous one for the record to be included into history.
Trigger a record to history. The current state of at least one atom must be different from the previous one for the record to be included into history.
(with-single-before-and-after & content)
(with-single-before-and-after &form &env & content)
Deactivate the watches write to history and execute the body. If any non-passive atom is modified, replace the last history with a snapshot taken just before executing the body and then take another snapshot.
Deactivate the watches write to history and execute the body. If any non-passive atom is modified, replace the last history with a snapshot taken just before executing the body and then take another snapshot.
(with-single-record & content)
(with-single-record &form &env & content)
Temporarily deactivate the watches write to history. A single write is triggered at the end of the macro, assuming at least one of the atoms watched by the overseer has changed.
Temporarily deactivate the watches write to history. A single write is triggered at the end of the macro, assuming at least one of the atoms watched by the overseer has changed.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close