Liking cljdoc? Tell your friends :D

toucan2.protocols


IDispatchValuecljprotocol

Protocol to get the value to use for multimethod dispatch in Toucan from something.

Protocol to get the value to use for multimethod dispatch in Toucan from something.

dispatch-valueclj

(dispatch-value this)

Get the value that we should dispatch off of in multimethods for this. By default, the dispatch of a keyword is itself while the dispatch value of everything else is its [[type]].

Get the value that we should dispatch off of in multimethods for `this`. By default, the dispatch of a keyword is
itself while the dispatch value of everything else is its [[type]].
sourceraw docstring

IModelcljprotocol

Protocol for something that is-a or has-a model.

Protocol for something that is-a or has-a model.

modelclj

(model this)

Get the Toucan model associated with this.

Get the Toucan model associated with `this`.
sourceraw docstring

IRecordChangescljprotocol

Protocol for something that records the changes made to it, e.g. a Toucan instance.

Protocol for something that records the changes made to it, e.g. a Toucan instance.

changesclj

(changes instance)

Get a map with any changes made to instance since it came out of the DB. Only includes keys that have been added or given different values; keys that were removed are not counted. Returns nil if there are no changes.

Get a map with any changes made to `instance` since it came out of the DB. Only includes keys that have been
added or given different values; keys that were removed are not counted. Returns `nil` if there are no changes.

currentclj

(current instance)

Return the underlying map representing the current state of an instance.

Return the underlying map representing the current state of an `instance`.

originalclj

(original instance)

Get the original version of instance as it appeared when it first came out of the DB.

Get the original version of `instance` as it appeared when it first came out of the DB.

with-currentclj

(with-current instance new-current)

Return a copy of instance with its underlying current map set to new-current.

Return a copy of `instance` with its underlying `current` map set to `new-current`.

with-originalclj

(with-original instance new-original)

Return a copy of instance with its original map set to new-original.

Return a copy of `instance` with its `original` map set to `new-original`.
sourceraw docstring

IWithModelcljprotocol

Protocol for something that has-a model that supports creating a copy with a different model.

Protocol for something that has-a model that supports creating a copy with a different model.

with-modelclj

(with-model this new-model)

Return a copy of instance with its model set to new-model.

Return a copy of `instance` with its model set to `new-model.`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close