Tools for identifying entity maps & creating ident functions.
An 'ident function' is a function that takes a map and returns a tuple [:key val] that uniquely identifies the entity the map describes.
Tools for identifying entity maps & creating ident functions. An 'ident function' is a function that takes a map and returns a tuple [:key val] that uniquely identifies the entity the map describes.
(by f)
(by f & fns)
Takes a number of functions. Returns an ident function that calls the first function on a map, then the second, and so on until one of the functions returns a non-nil value, which should be an ident.
Returns nil if all functions return nil.
Takes a number of functions. Returns an ident function that calls the first function on a map, then the second, and so on until one of the functions returns a non-nil value, which should be an ident. Returns nil if all functions return nil.
(by* fns)
Takes a collection of functions. Returns an ident function that calls the first function on a map, then the second, and so on until one of the functions returns a non-nil value, which should be an ident.
Returns nil if all functions return nil.
Takes a collection of functions. Returns an ident function that calls the first function on a map, then the second, and so on until one of the functions returns a non-nil value, which should be an ident. Returns nil if all functions return nil.
(by-keys key)
(by-keys key & keys)
Takes a number of keys. Returns an ident function that looks for the first key in a map, then the second, and so on until it finds a matching key, then returns an ident using that key and the value found.
Returns nil if no keys are found.
Takes a number of keys. Returns an ident function that looks for the first key in a map, then the second, and so on until it finds a matching key, then returns an ident using that key and the value found. Returns nil if no keys are found.
(by-keys* keys)
Takes a collection of keys. Returns an ident function that looks for the first key in a map, then the second, and so on until it finds a matching key, then returns an ident using that key and the value found.
Returns nil if no keys are found.
Takes a collection of keys. Returns an ident function that looks for the first key in a map, then the second, and so on until it finds a matching key, then returns an ident using that key and the value found. Returns nil if no keys are found.
(ident k v)
Takes a key and value and returns an ident.
Takes a key and value and returns an ident.
(identify-by-key entity key)
Takes an entity and a key, and returns an ident using key and value in entity if found. Otherwise returns nil.
Takes an entity and a key, and returns an ident using key and value in entity if found. Otherwise returns nil.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close