This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-11
Channels
- # beginners (57)
- # boot (9)
- # clara (9)
- # cljs-dev (12)
- # clojure (98)
- # clojure-boston (1)
- # clojure-dusseldorf (12)
- # clojure-france (1)
- # clojure-greece (1)
- # clojure-spec (41)
- # clojure-uk (86)
- # clojurescript (60)
- # code-art (2)
- # data-science (5)
- # datomic (5)
- # duct (1)
- # fulcro (14)
- # graphql (2)
- # lein-figwheel (4)
- # luminus (1)
- # midje (1)
- # off-topic (19)
- # om (10)
- # onyx (13)
- # pedestal (5)
- # portkey (59)
- # re-frame (31)
- # reagent (1)
- # ring (14)
- # ring-swagger (1)
- # rum (5)
- # shadow-cljs (90)
- # spacemacs (5)
- # specter (47)
- # sql (9)
- # uncomplicate (95)
- # vim (32)
I have a nested json data structure that isn't being decoded. Only the first level is being decoded and it leaves the maps coded as js json.
(let [sales-results (js->clj (.parse js/JSON (-> data :results :sales-results)) :keywordize-keys true)]
result:
[{"type":"SalesOrder","createdfrom":"","statusref":"pendingApproval"......
What have I done wrong?hi, using matchbox library from clojure code works well if firebase permission write = true. However, server code is supposed to use path/to/serviceAccountKey.json
file to have permissions to write. Has anyone used this with matchbox, and if yes, how?
I have an npm dependency that does this:
try {
var expo = require("expo");
} catch(e) {
console.log("expo is not defined, using internal guid");
}
That makes clojure ignore the entire dependency because it can’t find “expo.” Is there someway to ignore the error?I've been using https://github.com/noprompt/garden, great if you want to do hiccup like css generation.
given that cljs-http returns channels, how might one go about waiting for a collection of requests to complete before proceeding? such as mapping post
over a few URLS and collecting the results into a single, realized collection?
@tomaas maybe it's a static field: (new FirebaseOptions/Builder)
, and that's the extent of my interop knowledge i'm afraid
@tomaas close but not quite there. that's taking from each channel and calling a function with the results, but it still doesn't know when all requests have been completed
i'm trying to end up with something like this (!> single-result-channel [body1 body2 body3])
yes but doseq returns nil, so i can't map or reduce over the results taken from the channels in one go. 'do-something' will be called individually for each get request and won't have awareness of the other responses. (sorry, i'm not yet totally comfortable with channels)
i'm looking for something equivalent to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
anywho i found a working example here, half way down under the section "Returning Values in Order" http://clojurescriptmadeeasy.com/blog/promises-with-core-async.html
(defn into [coll & chans]
(go-loop [coll coll
chans chans]
(if (seq chans)
(recur (conj coll (<! (first chans)))
(rest chans))
coll)))
I am trying to interop a High Order Component used in https://github.com/okgrow/react-native-joyride. The code for HOC is:
export default joyride()(App);
class App extends React.Component {
render() {
return (
<View style={styles.container}>
<JoyrideStep text="Hey! This is the first step of the tour!" order={1} name="openApp">
<JoyrideText style={styles.title}>
Welcome to the demo of
{'\n'}
"React Native Joyride"
</JoyrideText>
</JoyrideStep>
<View style={styles.middleView}>
<JoyrideStep text="Here goes your profile picture!" order={2} name="secondText">
<JoyrideImage
source={{ uri: 'https://pbs.twimg.com/profile_images/527584017189982208/l3wwN-l-_400x400.jpeg' }}
style={styles.profilePhoto}
/>
</JoyrideStep>
<TouchableOpacity style={styles.button} onPress={() => this.props.start()}>
<Text style={styles.buttonText}>START THE TUTORIAL!</Text>
</TouchableOpacity>
</View>
<View style={styles.row}>
<JoyrideStep text="Here is an item in the corner of the screen." order={3} name="thirdText">
<JoyrideText style={styles.tabItem}>
<Ionicons name="ios-contact" size={40} color="#888" />
</JoyrideText>
</JoyrideStep>
<Ionicons style={styles.tabItem} name="ios-game-controller-b" size={40} color="#888" />
<Ionicons style={styles.tabItem} name="ios-globe" size={40} color="#888" />
<Ionicons style={styles.tabItem} name="ios-navigate-outline" size={40} color="#888" />
<Ionicons style={styles.tabItem} name="ios-rainy" size={40} color="#888" />
</View>
</View>
);
}
}
Im trying this :
(def JoyRide (js/require "react-native-joyride"))
(def joy (r/adapt-react-class (.-joyride JoyRide)))
(defn home-page []
[joy (r/reactify-component
[JoyrideStep
(clj->js {:text "FIrst step"
:order 11
:name "openApp"})
[JoyrideText
"Welcome to the demo"]])]
(def pages
{:home #'home-page
:phone #'phone-page
:pay #'pay-page
:video #'video-page
:intro #'intro-page})
I am not a valid react class. Can someone help me?@sachinharpalani use [:> joy
[:> JoyrideStep
https://www.opensourcery.co.za/2017/02/12/using-semantic-ui-react-with-re-frame/
@lovuikeng i refactored app-root function (https://stackoverflow.com/questions/45909731/react-hoc-wrapping-with-clojurescript-and-reagent) to this:
(defn app-root []
(let [m (-> [(pages @(subscribe [:get-page]))]
r/reactify-component
joy
(r/adapt-react-class))]
[m]))
I am still getting the issue : Component(...):A valid react class must be returnedthere is no need for r/reactify-component
since joy
itself is already a react component, correct?
@lovuikeng the
r/reactify-component
is for [(pages @(subscribe [:get-page]))]
because to my understanding HOC is a function that takes React Component as input and outputs a new React Component@lovuikeng Also i removed r/adapt-react-class to joy
(def joy (.-joyride JoyRide))
since i am anyway using adapt-react-class in macroum.. don't see joyride in https://github.com/cljsjs
@lovuikengI am actually working on react native app
@lovuikeng this is the exact js file that im trying to interop https://github.com/okgrow/react-native-joyride/blob/master/example/App.js
facing difficulty in export default joyride()(App);
sorry, @sachinharpalani I speak only clojurescript 😞
@lovuikeng Its okay, i apologize i didnt mention that earlier 😞
Simple data representation question. How do you represent your data returned from Ajax calls. Req 1) We should be able to show loading when data is fetched 2) We should be able to show error if it errors 3) We show the data when available I prefer the following structure
{
:in-process false
:data nil
:has-errored true
:error "InvalidRequest"
}
@rnagpal good reference from re-frame https://github.com/Day8/re-frame/blob/master/docs/Talking-To-Servers.md
binaryage/cljs-devtools
formatters now works on firefox 57+ (but still says that dont work 😛 )
@souenzzo I will look into that, I wasn't aware that Firefox was about to implement support for custom formatters
@souenzzo: why do you think it should work? I'm looking at https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Custom_output and there is no mention of support for chrome's custom formatters (aka window.devtoolsFormatters)
if they supported the same feature, that would be cool, we would just tweak https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/formatters.cljs#L14-L16
I'm trying to get cljs.spec.alpha/coll-of
to work with eval-str
. Thanks to a tip from mfikes, I think I need my :load
function to look something like this:
:load (fn [_ cb] (cb {:lang :clj
:source the-complete-source-of-cljs.spec.alpha}))}
Does anyone know of a good way to get the source of cljs.spec.alpha
? Alternatively, is it maybe possible to clone or just use the current compiler state?