Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

fulcro.client.cards


defcard-fulcroclj/smacro

(defcard-fulcro & exprs)

Create a devcard with a full-blown Fulcro application. The arguments are identical to the devcard's defcard, and fulcro options can simply be added to that map under the :fulcro key as a map.

Initial state is handled as folows:

  1. The card's atom is always used to hold the state
  2. If you supply normal devcard state that is not empty, then it will be the state of the application, even if you use InitialAppState
  3. If the card's state atom starts empty, then InitialAppState will be used on card start

Note that hot code reload works properly: that is to say that the application within the card will not reinitialize on hot code reload. If you want to update initial state or run the started-callback, then you must reload the page.

NOTE: The fulcro application will be placed in an atom on a symbol that is named after the card: cardname-fulcro-app

Examples:

(defcard-fulcro my-card RootUI)

; with markdown doc (defcard-fulcro my-next-card ; app is in atom at my-next-card-fulcro-app "# Markdown!" RootUI)

(defcard-fulcro my-other-card ; app is in atom at my-other-card-fulcro-app RootUI {} ; required, as initial atom, but empty, so InitialAppState used if present {:inspect-data true ;devcard options :fulcro {:started-callback (fn [] (js/console.log "Hello"))}}) ; fulcro options

(defcard-fulcro state-card ; app is in atom at state-card-fulcro-app RootUI {:a 1} ; FORCE initial state. Ignores InitialAppState {:inspect-data true})

See Bruce Hauman's devcards for more information.

Create a devcard with a full-blown Fulcro application. The arguments are identical to the devcard's
defcard, and fulcro options can simply be added to that map under the :fulcro key as a map.

Initial state is handled as folows:

1. The card's atom is always used to hold the state
2. If you supply normal devcard state that is *not* empty, then it will be the state of the application,
**even if** you use InitialAppState
3. If the card's state atom starts empty, then InitialAppState will be used on card start

Note that hot code reload works properly: that is to say that the application within the card will
not reinitialize on hot code reload. If you want to update initial state or run the started-callback, then
you must reload the page.

NOTE: The fulcro application will be placed in an atom on a symbol that is named after the card: `cardname-fulcro-app`

Examples:

(defcard-fulcro my-card RootUI)

; with markdown doc
(defcard-fulcro my-next-card ; app is in atom at my-next-card-fulcro-app
   "# Markdown!"
   RootUI)

(defcard-fulcro my-other-card ; app is in atom at my-other-card-fulcro-app
   RootUI
   {} ; required, as initial atom, but empty, so InitialAppState used if present
   {:inspect-data true  ;devcard options
    :fulcro {:started-callback (fn [] (js/console.log "Hello"))}}) ; fulcro options

(defcard-fulcro state-card ; app is in atom at state-card-fulcro-app
   RootUI
   {:a 1} ; FORCE initial state. Ignores InitialAppState
   {:inspect-data true})

See Bruce Hauman's devcards for more information.
sourceraw docstring

fulcro-applicationclj/smacro

(fulcro-application app-sym root-ui & args)

Embed a Fulcro client application in a devcard. The args can be any args you'd normally pass to new-fulcro-client except for :initial-state (which is taken from InitialAppState or the card's data). The card's data (which must be a normalized db) will override InitialAppState if it is not empty.

Your application will be placed in an atom at the symbol you specify.

(defcard my-card (fulcro-application my-app-symbol UIRoot))

Embed a Fulcro client application in a devcard. The `args` can be any args you'd
normally pass to `new-fulcro-client` except for `:initial-state` (which is taken from
InitialAppState or the card's data). The card's data (which must be a normalized db) will override InitialAppState if it is *not* empty.

Your application will be placed in an atom at the symbol you specify.

(defcard my-card
   (fulcro-application my-app-symbol UIRoot))
sourceraw docstring

make-rootcljs

(make-root component-class params)

Make a root for use in a devcard. This allows you to embed a component with an ident into a devcard without having to manually create a placeholder root component. The params are passed to get-initial-state of the component class.

Make a root for use in a devcard. This allows you to embed a component with an ident into a devcard without having
to manually create a placeholder root component. The params are passed to `get-initial-state` of the component
class.
sourceraw docstring

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

× close