Liking cljdoc? Tell your friends :D

dar.container

Examples: (application app)

(define :a 1) (define :b 2)

(define :ab :args [:a :b] :fn +)

(evaluate (start app) :ab) => 3

Examples:
(application app)

(define :a 1)
(define :b 2)

(define :ab
:args [:a :b]
:fn +)

(evaluate (start app) :ab) => 3
raw docstring

<?!evaluateclj

(<?!evaluate app k)
source

applicationcljmacro

(application name)

Declares a new Var initialized with an empty spec, i.e. (def name {}). Use define, include or swap to add task definitions.

Examples: (application foo) (define :a 1)

(application bar) (define :a 2)

foo => {:a {:value 1}} bar => {:a {:value 2}}

Declares a new Var initialized with an empty spec, i.e. (def name {}).
Use define, include or swap to add task definitions.

Examples:
(application foo)
(define :a 1)

(application bar)
(define :a 2)

foo => {:a {:value 1}}
bar => {:a {:value 2}}
sourceraw docstring

defappcljmacro

(defapp name & body)

Like (application ...), but it doesn't use Var hacks, allows only in-place definitions.

Examples: (defapp foo (define :a 1))

foo => {:a {:value 1}}

Like (application ...), but it doesn't use Var hacks,
allows only in-place definitions.

Examples:
(defapp foo
(define :a 1))

foo => {:a {:value 1}}
sourceraw docstring

defineclj

(define k & args)

Define a task k in the current spec.

Examples: (application app)

(define :a 1) ; define a value :a

(define :b ; define a task (computable value) :b :args [:a] :fn inc)

(define :resource :close #(.close %) ; Make task closeable by providing cleanup function ; for result value (see stop!) :pre [:foo :bar] ; Specifiy task prerequisites, that do not need to be passed as arguments )

Define a task k in the current spec.

Examples:
(application app)

(define :a 1)         ; define a value :a

(define :b            ; define a task (computable value) :b
:args [:a]
:fn inc)

(define :resource
:close #(.close %)  ; Make task closeable by providing cleanup function
; for result value (see stop!)
:pre [:foo :bar]    ; Specifiy task prerequisites, that do not need to be passed as arguments
)
sourceraw docstring

define*clj

(define* spec k & args)
source

evaluateclj

(evaluate app k)

Evaluate the task k. If computation is async returns a promise, otherwise result value (which might be an Exception).

Evaluate the task k. If computation is async returns
a promise, otherwise result value (which might be an Exception).
sourceraw docstring

includeclj

(include spec)

Merge tasks from the given spec into the current.

Merge tasks from the given spec into the current.
sourceraw docstring

noopclj

(noop & _)
source

requiresclj

(requires spec)

Returns a list of tasks that are used as dependecies but not defined. Convenient for exploring third-party specs.

Returns a list of tasks that are used as dependecies but not defined.
Convenient for exploring third-party specs.
sourceraw docstring

spec-var-atomclj

(spec-var-atom)
source

startclj

(start app)
(start app vals)
(start app level vals)

Create a new container instance from either spec or another app. In latter case the given app will be used as parent.

Create a new container instance from either spec or another app.
In latter case the given app will be used as parent.
sourceraw docstring

stop!clj

(stop! app)

Close all closeable values of the given instance.

Close all closeable values of the given instance.
sourceraw docstring

swapclj

(swap f & args)

Update the current spec by applying f to a spec value and args.

Update the current spec by applying f to a spec value and args.
sourceraw docstring

with-appcljmacro

(with-app app & body)

Extend the given app with define, include or swap functions

Examples: (with-app {:a {:value 1}} (define :b 2)) => {:a {:value 1}, :b {:value 2}}

Extend the given app with define, include or swap functions

Examples:
(with-app {:a {:value 1}}
(define :b 2)) => {:a {:value 1}, :b {:value 2}}
sourceraw docstring

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

× close