mirror of https://github.com/status-im/reagent.git
Merge pull request #345 from pesterhazy/fix/docs
Use spaces, not tabs in code example
This commit is contained in:
commit
0c4cc740c1
|
@ -11,20 +11,20 @@ We'll start with a code fragment, because it is worth a 1000 words:
|
|||
```cljs
|
||||
(defn video-ui []
|
||||
(let [!video (clojure.core/atom nil)] ;; stores the
|
||||
(fn [{:keys [src]}]
|
||||
[:div
|
||||
[:div
|
||||
[:video {:src src
|
||||
:style {:width 400}
|
||||
:ref (fn [el]
|
||||
(reset! !video el))}]]
|
||||
[:div
|
||||
[:button {:on-click (fn []
|
||||
(when-let [video @!video] ;; not nil?
|
||||
(if (.-paused video)
|
||||
(.play video)
|
||||
(.pause video))))}
|
||||
"Toogle"]]])))
|
||||
(fn [{:keys [src]}]
|
||||
[:div
|
||||
[:div
|
||||
[:video {:src src
|
||||
:style {:width 400}
|
||||
:ref (fn [el]
|
||||
(reset! !video el))}]]
|
||||
[:div
|
||||
[:button {:on-click (fn []
|
||||
(when-let [video @!video] ;; not nil?
|
||||
(if (.-paused video)
|
||||
(.play video)
|
||||
(.pause video))))}
|
||||
"Toogle"]]])))
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
|
Loading…
Reference in New Issue