Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fix missing demo definitions in core profile
Browse files Browse the repository at this point in the history
[Re #23] [Fix #23]
  • Loading branch information
Damian Hryniewicz committed Sep 7, 2020
1 parent 846fdd5 commit 755d13e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## Changed
- [Issue 24] - `reagent.core/render` is deprecated. Now we use `reagent.dom/render` instead.

### Fixed
- [Issue 23] - Now the DELETEME-demo-* functions definitions will get generated for all profiles.

## [0.4.3] - 2020-07-01
### Changed
- Use newer versions of dependencies
Expand Down Expand Up @@ -166,4 +169,5 @@ This version unifies it to `rf`.
[0.1.4]: https://github.com/magnetcoop/hydrogen.duct-template/v0.1.4
[0.1.3]: https://github.com/magnetcoop/hydrogen.cljs.duct-template/v0.1.3

[Issue 23]: https://github.com/magnetcoop/hydrogen.duct-template/issues/23
[Issue 24]: https://github.com/magnetcoop/hydrogen.duct-template/issues/24
26 changes: 13 additions & 13 deletions resources/core/cljs/home.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
{{=<< >>=}}
(ns <<namespace>>.client.home
(:require [re-frame.core :as rf]<<#hydrogen-session?>>
[<<namespace>>.client.session :as session]
[<<namespace>>.client.session :as session]<</hydrogen-session?>>
[<<namespace>>.client.tooltip :as tooltip]
[<<namespace>>.client.tooltip.loading-popup :as loading-popup]
[<<namespace>>.client.tooltip.loading-popup :as loading-popup]<<#hydrogen-session?>>
[<<namespace>>.client.user :as user]<</hydrogen-session?>>
[<<namespace>>.client.view :as view]))

(rf/reg-event-fx
::go-to-home
(fn [_ _]
{:dispatch [::view/set-active-view :home]
:redirect "/#/home"}))<<#hydrogen-session?>>
:redirect "/#/home"}))

;; This section contains code solely for demo purposes.
;; Go ahead and delete it.
(rf/reg-event-fx
::DELETEME-demo-request
(fn [_ _]
{:dispatch [::loading-popup/set-loading "Faking loading. I'll disappear after 5 seconds..."]
;; This http-xhrio should be there instead of the dispatch-later in real situation.
; http-xhrio {...}
:dispatch-later [{:ms 5000
:dispatch [::loading-popup/stop-loading]}]}))
{:dispatch [::loading-popup/set-loading "Faking loading. I'll disappear after 5 seconds..."]
;; This http-xhrio should be there instead of the dispatch-later in real situation.
; http-xhrio {...}
:dispatch-later [{:ms 5000
:dispatch [::loading-popup/stop-loading]}]}))

(defn- DELETEME-demo-tooltip-component []
[:div
"Hello! I'm a demo tooltip. "
[:a.u-clickable
{:on-click #(rf/dispatch [::tooltip/destroy-by-id "generic-popup"])} "x"]])
[:div
"Hello! I'm a demo tooltip. "
[:a.u-clickable
{:on-click #(rf/dispatch [::tooltip/destroy-by-id "generic-popup"])} "x"]])

(defn- DELETEME-demo-tooltip []
[:button.btn
Expand All @@ -44,7 +44,7 @@
(defn- DELETEME-demo-loading []
[:button.btn {:on-click #(rf/dispatch [::DELETEME-demo-request])}
"Pretend you are requesting something from the Internet"])
;; end of obsolete demo code
;; end of obsolete demo code<<#hydrogen-session?>>

(defn- user-details []
(let [user-data (rf/subscribe [::user/user-data])]
Expand Down

0 comments on commit 755d13e

Please sign in to comment.