Liking cljdoc? Tell your friends :D

com.fulcrologic.fulcro.algorithms.transit

Transit functions for the on-the-wire EDN communication to common remotes. Includes support for Fulcro tempids, and can be extended to support additional application-specific data types.

Transit functions for the on-the-wire EDN communication to common remotes. Includes support for Fulcro tempids,
and can be extended to support additional application-specific data types.
raw docstring

install-type-handler!clj/s

(install-type-handler! t)

Install a type handler (generated by type-handler) into the global Fulcro transit support registry. This registry can be used by any Fulcro-aware facility that needs to use transit for any standard purpose where app-specific type support is desired.

Install a type handler (generated by `type-handler`) into the global Fulcro transit support registry. This registry
can be used by any Fulcro-aware facility that needs to use transit for any standard purpose where app-specific type
support is desired.
sourceraw docstring

read-handlersclj/s

(read-handlers)

Returns a map that can be used for the :handlers key of a transit reader, taken from the current type handler registry.

Returns a map that can be used for the :handlers key of a transit reader, taken from the current type handler registry.
sourceraw docstring

readerclj/s≠

clj
(reader in)
(reader in opts)
cljs
(reader)
(reader opts)

Create a transit reader.

  • opts: (optional) options to pass to cognitect.transit/reader (such as data type handlers).
Create a transit reader.

- `opts`: (optional) options to pass to `cognitect.transit/reader` (such as data type handlers).
source (clj)source (cljs)raw docstring

serializable?clj/s

(serializable? v)

Checks to see that the value in question can be serialized by the default fulcro writer by actually attempting to serialize it. This is not an efficient check.

Checks to see that the value in question can be serialized by the default fulcro writer by actually attempting to
serialize it.  This is *not* an efficient check.
sourceraw docstring

TempIdHandlercljs

source

transit-clj->strclj/s

(transit-clj->str data)
(transit-clj->str data opts)

Use transit to encode clj data as a string. Useful for encoding initial app state from server-side rendering.

  • data: Arbitrary data
  • opts: (optional) Options to send when creating a writer. Always preserves metadata. Adding :metadata? true/false will turn on/off metadata support. Defaults to on.
Use transit to encode clj data as a string. Useful for encoding initial app state from server-side rendering.

- `data`: Arbitrary data
- `opts`: (optional) Options to send when creating a `writer`. Always preserves metadata. Adding :metadata? true/false
  will turn on/off metadata support. Defaults to on.
sourceraw docstring

transit-handlersclj/s

source

transit-str->cljclj/s

(transit-str->clj str)
(transit-str->clj str opts)

Use transit to decode a string into a clj data structure. Useful for decoding initial app state when starting from a server-side rendering.

Use transit to decode a string into a clj data structure. Useful for decoding initial app state
when starting from a server-side rendering.
sourceraw docstring

type-handlerclj/s

(type-handler type tag type->ground ground->type)

Creates a map that can be registered with Fulcro's transit support.

  • type is a deftype or defrecord that represents your runtime data that you want to support in Transit
  • tag is a string that uniquely identifies your type on the wire
  • type->ground is a function that can take an instance of your type and turn it into something transit already knows how to handle.
  • ground->type is a function that can take whatever type->ground generated and turn it back into your type.

This function returns a map that contains a :reader and :writer key. The value at these keys is suitable for merging at the :handlers key of a reader or writer's option map.

See also install-type-handler! for adding this to Fulcro's registry of type support.

Creates a map that can be registered with Fulcro's transit support.

* `type` is a `deftype` or `defrecord` that represents your runtime data that you want to support in Transit
* `tag` is a string that uniquely identifies your type on the wire
* `type->ground` is a function that can take an instance of your `type` and turn it into something transit already
knows how to handle.
* `ground->type` is a function that can take whatever `type->ground` generated and turn it back into your `type`.

This function returns a map that contains a :reader and :writer key. The value at these keys is suitable for merging
at the `:handlers` key of a reader or writer's option map.

See also `install-type-handler!` for adding this to Fulcro's registry of type support.
sourceraw docstring

write-handlersclj/s

(write-handlers)

Returns a map that can be used for the :handlers key of a transit writer, taken from the current type handler registry.

Returns a map that can be used for the :handlers key of a transit writer, taken from the current type handler registry.
sourceraw docstring

writerclj/s≠

clj
(writer out)
(writer out opts)

Create a transit writer.

  • out: An acceptable output for transit writers.
  • opts: (optional) options to pass to cognitect.transit/writer (such as data type handlers).
Create a transit writer.

- `out`: An acceptable output for transit writers.
- `opts`: (optional) options to pass to `cognitect.transit/writer` (such as data type handlers).
cljs
(writer)
(writer opts)

Create a transit writer.

  • out: An acceptable output for transit writers.
  • opts: (optional) options to pass to cognitect.transit/writer (such as handlers).
Create a transit writer.

- `out`: An acceptable output for transit writers.
- `opts`: (optional) options to pass to `cognitect.transit/writer` (such as handlers).
source (clj)source (cljs)raw docstring

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

× close