(add-post-build-fn factory post-build-fn)
Add the given post-build function to the factory.
After the product is built, the post-build functions will be applied sequentially.
A post-build function should be of arity 2, with the first argument being the product and the second argument being the factory map.
Add the given post-build function to the factory. After the product is built, the post-build functions will be applied sequentially. A post-build function should be of arity 2, with the first argument being the product and the second argument being the factory map.
(add-trait factory trait-name trait-params)
Add the given trait to the factory.
Trait params could be applied to the factory with the trait
function.
Add the given trait to the factory. Trait params could be applied to the factory with the `trait` function.
(build {:keys [factory-fn spec fields post-build-fns] :as factory})
Build a product with the factory.
The products will be builts with the following step:
factory-fn
producing a productfields
will be merged recursively to the productpost-build-fns
will be applied to the product sequentiallyspec
Build a product with the factory. The products will be builts with the following step: 1. the factory map will be supplied to `factory-fn` producing a product 2. `fields` will be merged recursively to the product 3. `post-build-fns` will be applied to the product sequentially 4. the product will be validated against `spec`
(build-args factory build-args)
Add the given build arguments to the factory. Existing build argument of the same key will be overriden.
Build arguments will be supllied to factory-fn
when building.
Add the given build arguments to the factory. Existing build argument of the same key will be overriden. Build arguments will be supllied to `factory-fn` when building.
(deep-merge l r)
Recursively merge two maps.
Recursively merge two maps.
(fields factory fields)
Add the given fields to the factory. The new fields will be merged recursively to the existing fields.
Fields will be merged recursively to the products when building.
Add the given fields to the factory. The new fields will be merged recursively to the existing fields. Fields will be merged recursively to the products when building.
(spec factory spec-object)
Apply the given spec to the factory.
Products will be validated against the spec when building.
Apply the given spec to the factory. Products will be validated against the spec when building.
(trait factory trait-name)
Apply trait of the given name to the factory.
Throw if a trait of the give name was not defined.
Apply trait of the given name to the factory. Throw if a trait of the give name was not defined.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close