This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-25
Channels
- # announcements (5)
- # beginners (74)
- # boot (5)
- # cider (57)
- # cljdoc (5)
- # cljs-dev (45)
- # clojure (37)
- # clojure-dev (6)
- # clojure-europe (4)
- # clojure-italy (17)
- # clojure-nl (11)
- # clojure-spec (48)
- # clojure-uk (96)
- # clojurescript (79)
- # cursive (17)
- # data-science (1)
- # datomic (27)
- # emacs (2)
- # fulcro (22)
- # immutant (1)
- # java (62)
- # juxt (4)
- # kaocha (4)
- # lein-figwheel (5)
- # leiningen (6)
- # midje (1)
- # mount (1)
- # music (3)
- # nrepl (6)
- # off-topic (49)
- # pathom (10)
- # pedestal (2)
- # re-frame (43)
- # reagent (2)
- # ring (2)
- # shadow-cljs (78)
- # spacemacs (6)
- # test-check (2)
- # tools-deps (4)
Guys, do you know how to find Clojurescript React and React-Native template to buy ?
I'm not sure what that would mean @U3JJH3URY
Cljs and reframe are not like WordPress
There are tons of templates, production-ready template projects written in React and/or React Native, over the internet. Is there for Clojurescript ?
There could be but I doubt
I couldn’t found anytying. Also, I always proud of my Google-ing. I want to ask before I consider there are not any of them.
I doubt there could be any market for something like that
Just look at example projects
As a starting point
Hi re-framers! I'm working my way through the todomvc example ( https://github.com/Day8/re-frame/tree/master/examples/todomvc ), and could use some insights.. So, our goal should be to have all of application state in app-db, so that the view can be derived from that only source. Despite this, there are some properties that are defined as "component-local" ratoms, such as the editing flag at https://github.com/Day8/re-frame/blob/01c63cc4b30591510acf415479b8e6d0614d5c1b/examples/todomvc/src/todomvc/views.cljs#L29 . This way app-db is no longer a definitive app state store, is it? Or, should we not consider "editing" to be part of the application state? If so, how do you decide what is state (as in: part of app-db) and what isn't...?
Hey friends, I'm trying to initiate a save file dialogue using day8-re-frame.http-fx
. I see that hte file is being downloaded in the network tab as I can see the preview. But I'm unsure of how to handle this
(rf/safe-reg-event-fx
:download-something
(fn [{:keys [db]} _]
{:http-xhrio {:method :get
:uri "/test"
:on-success [:do-something]
:on-failure [:do-somethingelse]
:format (ajax/transit-request-format)
:response-format (ajax/transit-response-format)}}))
Hi @petr, I think your server should return the response with Content-Disposition
header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
Even with that header it still doesn't appear to work
HTTP/1.1 200 OK
Content-Type: image/png
Content-Disposition: attachment
X-Xss-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Content-Length: 51601
Server: http-kit
Date: Mon, 25 Feb 2019 16:22:32 GMT
One option is to use a js-library such as https://github.com/eligrey/FileSaver.js/ to handle the download. Though (AFAIK) Content-Disposition
header is the preferred way when the file comes from the server.
Ehhh, the problem is probably that you can’t trigger file download with AJAX-request.
So if I take a look inside of my on-failure
handler. There is this:
"EEEEEEEEEEEEE" {:response nil, :last-method "GET", :original-text "����JFIF���\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\...
It looks like its getting the binary data, but I need to push that to a file for the user to enter the dialogue
Though.. It’s possible also to get the blob from Ajax-request and hand it over to filesaver.js and let it do some magic to popup the dialog
@petr you can check this out https://github.com/lipas-liikuntapaikat/lipas/blob/dev/webapp/src/cljs/lipas/ui/reports/events.cljs#L52-L76 and https://github.com/lipas-liikuntapaikat/lipas/blob/dev/webapp/src/cljs/lipas/ui/effects.cljs#L17-L20
when i dispatch above code from REPL? I get error "RuntimeException Invalid token: ::events/initialize-db"
@anish.developer the double colon in ::events/initialize-db
refers to an alias. If for example you were to require a namespace such as (require '[my-re-frame.events :as events])
the keyword ::events/initialize-db
would then expand to a fully qualified keyword :my-re-frame.events/initialize-db
. So it depends on how your reg-event-db
is defined, if you have used something like :events/initialize-db
(with a single colon) then it is already fully qualified and you can just use it as is with the single colon, if you defined it like ::initialized-db
then it will take on the name of the current namespace and you with have to either refer to the the fully qualified key or alias the namespace using require.