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
|
```cljs
|
||||||
(defn video-ui []
|
(defn video-ui []
|
||||||
(let [!video (clojure.core/atom nil)] ;; stores the
|
(let [!video (clojure.core/atom nil)] ;; stores the
|
||||||
(fn [{:keys [src]}]
|
(fn [{:keys [src]}]
|
||||||
[:div
|
[:div
|
||||||
[:div
|
[:div
|
||||||
[:video {:src src
|
[:video {:src src
|
||||||
:style {:width 400}
|
:style {:width 400}
|
||||||
:ref (fn [el]
|
:ref (fn [el]
|
||||||
(reset! !video el))}]]
|
(reset! !video el))}]]
|
||||||
[:div
|
[:div
|
||||||
[:button {:on-click (fn []
|
[:button {:on-click (fn []
|
||||||
(when-let [video @!video] ;; not nil?
|
(when-let [video @!video] ;; not nil?
|
||||||
(if (.-paused video)
|
(if (.-paused video)
|
||||||
(.play video)
|
(.play video)
|
||||||
(.pause video))))}
|
(.pause video))))}
|
||||||
"Toogle"]]])))
|
"Toogle"]]])))
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
Loading…
Reference in New Issue