Liking cljdoc? Tell your friends :D

unifier.response


as-errorclj/s

(as-error data)
(as-error type data)
(as-error type data meta)

Returns instance of unifier.response/UnifiedError. Examples:

  • with default error type (as-error "a user was not found")

  • with specified error type (as-error :user/not-found "a user was not found")

  • with specified error type and meta (as-error :user/not-found "john@doe.com" {:i18n/key :user/not-found})

Returns instance of `unifier.response/UnifiedError`.
Examples:
  * with default error `type`
  (as-error "a user was not found")

  * with specified error `type`
  (as-error :user/not-found "a user was not found")

  * with specified error `type` and `meta`
  (as-error :user/not-found "john@doe.com" {:i18n/key :user/not-found})
sourceraw docstring

as-responseclj/smultimethod

A dispatcher for the unified responses.

A dispatcher for the unified responses.
sourceraw docstring

as-successclj/s

(as-success data)
(as-success type data)
(as-success type data meta)

Returns instance of unifier.response/UnifiedSuccess. Examples:

  • with default success type (as-success "a user was created successfully")

  • with specified success type (as-success :user/created "a user was created successfully")

  • with specified success type and meta (as-success :user/created "a user was created successfully" {:i18n/key :user/created})

Returns instance of `unifier.response/UnifiedSuccess`.
Examples:
  * with default success `type`
  (as-success "a user was created successfully")

  * with specified success `type`
  (as-success :user/created "a user was created successfully")

  * with specified success `type` and `meta`
  (as-success :user/created "a user was created successfully" {:i18n/key :user/created})
sourceraw docstring

default-error-typeclj/s

Default error type.

Default error `type`.
sourceraw docstring

default-success-typeclj/s

Default success type.

Default success `type`.
sourceraw docstring

error?clj/s

(error? x)

Returns true if the given value is instance of unifier.response/UnifiedError. Otherwise false.

Returns `true` if the given value is instance of `unifier.response/UnifiedError`. Otherwise `false`.
sourceraw docstring

get-dataclj/s

(get-data x)

Returns data of response.

Returns `data` of response.
sourceraw docstring

get-metaclj/s

(get-meta x)

Returns meta of response.

Returns `meta` of response.
sourceraw docstring

get-typeclj/s

(get-type x)

Returns type of response.

Returns `type` of response.
sourceraw docstring

IUnifiedResponseclj/s≠protocol

-error?clj/s

(-error? _)

Returns true if the given value is instance of unifier.response/UnifiedError. Otherwise false.

Returns `true` if the given value is instance of `unifier.response/UnifiedError`. Otherwise `false`.

-get-dataclj/s

(-get-data _)

Returns data of response.

Returns `data` of response.

-get-metaclj/s

(-get-meta _)

Returns meta of response.

Returns `meta` of response.

-get-typeclj/s

(-get-type _)

Returns type of response.

Returns `type` of response.

-response?clj/s

(-response? _)

Returns true if the given value is implements unifier.response/IUnifiedResponse protocol. Otherwise false.

Returns `true` if the given value is implements `unifier.response/IUnifiedResponse` protocol. Otherwise `false`.

-success?clj/s

(-success? _)

Returns true if the given value is instance of unifier.response/UnifiedSuccess. Otherwise false.

Returns `true` if the given value is instance of `unifier.response/UnifiedSuccess`. Otherwise `false`.
source

response?clj/s

(response? x)

Returns true if the given value is implements unifier.response/IUnifiedResponse protocol. Otherwise false.

Returns `true` if the given value is implements `unifier.response/IUnifiedResponse` protocol. Otherwise `false`.
sourceraw docstring

set-default-error-type!clj/s

(set-default-error-type! type)

Overrides default error type.

Overrides default error `type`.
sourceraw docstring

set-default-success-type!clj/s

(set-default-success-type! type)

Overrides default success type.

Overrides default success `type`.
sourceraw docstring

success?clj/s

(success? x)

Returns true if the given value is instance of unifier.response/UnifiedSuccess. Otherwise false.

Returns `true` if the given value is instance of `unifier.response/UnifiedSuccess`. Otherwise `false`.
sourceraw docstring

UnifiedErrorcljs

source

UnifiedSuccesscljs

source

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

× close