This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-29
Channels
- # announcements (9)
- # aws (1)
- # beginners (133)
- # boot (2)
- # calva (94)
- # cider (48)
- # cljdoc (7)
- # cljsrn (22)
- # clojure (128)
- # clojure-europe (22)
- # clojure-finland (7)
- # clojure-greece (6)
- # clojure-losangeles (3)
- # clojure-nl (81)
- # clojure-spec (30)
- # clojure-uk (60)
- # clojure-ukraine (1)
- # clojurescript (45)
- # core-async (26)
- # cursive (18)
- # datomic (12)
- # defnpodcast (1)
- # duct (4)
- # editors (4)
- # emacs (6)
- # fulcro (37)
- # graphql (4)
- # jobs (2)
- # jobs-rus (1)
- # juxt (7)
- # kaocha (2)
- # leiningen (1)
- # nrepl (22)
- # off-topic (2)
- # re-frame (16)
- # reagent (8)
- # reitit (22)
- # ring-swagger (5)
- # shadow-cljs (81)
- # tools-deps (4)
Not strictly related to #cljsn, but my app still feels like a website (aka do not work offline) On browsers, we solve it using web workers, but on react native there is no web workers. How should I handle it in react-native? AsyncStorage is the right way?
As long as you don’t need to share data between apps (or with a share extension or similar), AsyncStorage is the way to go. Pretty easy key-value store that persists.
(.then (js/fetch "
.text
returns a promise, though, so watch out for that. https://developer.mozilla.org/en-US/docs/Web/API/Body/text
Unfortunately, not that I know of
(->
(js/fetch " ")
(.then (fn [resp] (println (.text resp))))
(.catch (fn [arg] (js/console.error arg))))
You’d need to wait on the promise coming from .text, like
(-> (js/fetch "")
(.then (fn [resp] (.text resp)))
(.catch (fn [arg] (js/console.error arg)))
(.then (fn [html-str] (println html-str))))
But generally what you have is good
IO just doesn’t wait in JS. Or if you try to wait, you get a “A script on this page is unresponsive…” error or a frozen UI, depending on the environment you’re running in
i just tried to use re-find
from repl but i wasn't able to.
#object[TypeError TypeError: undefined is not an object (evaluating 'cljs.core.re_matcher.call')]
was i wrong to think that clojure.core would be included/available in cljsrn?
i managed to use https://clojuredocs.org/clojure.core/subs... weird i might've been in weird repl state