Skip to content

selfsame/plomb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plomb

Sugar macros for linking Om components with core.async chans.

(ns examples.simple.core
  (:require
      [om.core :as om :include-macros true]
      [om.dom :as dom :include-macros true]
      [plomb.core :as plomb :include-macros true]))

(plomb/defcomp app
  [data owner opts]
  {:init-state
   (fn [_] {:count 0})
   :render-state
    (fn [_ state]
      (dom/button #js {:onClick #(plomb/emit! owner :foo {})} (:count state)))
   :catch {:foo
           (fn [e] (om/update-state! owner :count inc))}})

(om/root app (atom {}) {:target (.-body js/document)})

About

sugar macros for core.async communication between om components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published