membrane.component

*env*

dynamic

*sci-ctx*

dynamic

building-graalvm-image?

macro

(building-graalvm-image?)

cache-evict

cache-has?

cache-lookup-or-miss

cache-miss

cljs-env-compiler

cljs-resolve

cljs-resolve-var

component-cache

default-delete

(default-delete atm path)

default-get

(default-get atm path)

default-handler

(default-handler atm)

default-set

(default-set atm path v)

default-update

(default-update atm path f & args)

defeffect

macro

(defeffect type args & body)

Define an effect.

defeffect is a macro that does 3 things:

  1. It registers a global effect handler of type. type should be a keyword and since it is registered globally, should be namespaced
  2. It will define a var in the current namespace of effect-*type* where type is the name of the type keyword. This can be useful if you want to be able to use your effect functions in isolation
  3. It will implicitly add an additional argument as the first parameter named dispatch

The arglist for dispatch! is [type & args]. Calling dispatch! will invoke the effect of type with args. The role of dispatch! is to allow effects to define themselves in terms of other effects. Effects should not be called directly because while the default for an application is to use all the globally defined effects, this can be overridden for testing, development, or otherwise.

example:

(defeffect ::increment-number $num (dispatch! :update $num inc))

defui

macro

(defui ui-name & fdecl)

Define a component.

The arguments for a component must take the form (defui my-component [ & {:keys arg1 arg2 ...}])

dispatch!*

(dispatch!* atm dispatch! & args)

effect-clipboard-copy

(effect-clipboard-copy dispatch! s)

effect-clipboard-cut

(effect-clipboard-cut dispatch! s)

effects

has-key-event-memo

has-key-press-memo

has-mouse-move-global-memo

make-app

(make-app ui-var)(make-app ui-var initial-state)(make-app ui-var initial-state handler)

ui-var The var for a component initial-state The initial state of the component to run or an atom that contains the initial state. handler The effect handler for your UI. The handler will be called with all effects returned by the event handlers of your ui.

If handler is nil or an arity that doesn't specify handler is used, then a default handler using all of the globally defined effects from defeffect will be used. In addition to the globally defined effects the handler will provide 3 additional effects:

:update similar to update except instead of a keypath, takes a more generic path. example: [:update $ref inc]

:set sets the value given a $path example: [:set $ref val]

:delete deletes value at $path example: [:delete $ref]

make-app returns a view function.

path->spec

(path->spec elem)

path-replace

(path-replace form)(path-replace form deps)

Given a form, walk and replace all $syms with the lens (or path) for the sym with the same name.

path-replace-macro

macro

(path-replace-macro deps form)(path-replace-macro form)

reset-component-cache!

(reset-component-cache!)

For debugging purposes only. Ideally, should never be necessary.

resolve-sci-meta

(resolve-sci-meta sym)

sci-eval-form

special-fns

special-syms

top-level-ui

(top-level-ui {:keys [state body path-keys val-key-fns handler extra context]})

ui-var->top-level-ui

(ui-var->top-level-ui ui-var)