This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-03
Channels
- # announcements (4)
- # beginners (68)
- # boot (3)
- # business (20)
- # cider (39)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (12)
- # clojure (122)
- # clojure-brasil (2)
- # clojure-italy (7)
- # clojure-nl (5)
- # clojure-spec (60)
- # clojure-uk (41)
- # clojurescript (67)
- # cursive (7)
- # datomic (13)
- # emacs (6)
- # figwheel-main (18)
- # fulcro (40)
- # garden (3)
- # graphql (2)
- # hyperfiddle (4)
- # jobs-discuss (10)
- # lein-figwheel (5)
- # leiningen (12)
- # luminus (6)
- # mount (3)
- # off-topic (52)
- # portkey (2)
- # re-frame (1)
- # reagent (6)
- # reitit (24)
- # shadow-cljs (15)
- # sql (3)
- # tools-deps (12)
I'm new to cljs (but not to clojure) and react-native. I'm trying to use react-native-sensor-manager with re-natal and do not know how to translate the import statements here.
import React, {
DeviceEventEmitter // will emit events that you can listen to
} from 'react-native';
import { SensorManager } from 'NativeModules';
@zakwilson - You may want to consider using Reagent (or similar, there are others), which is a Clojuric / Clojurescript wrapper around React. That way, as long as you don't stray into waters that are completely uncharted you won't need to translate such things.
After looking at Reagent, om.next, and Rum, I picked Rum. I don't think Rum will do this for me.
I'm not sure Reagent has anything for me here either. This is a library written mostly in Java that makes the sensors on an Android device available from React.
@zakwilson - OK, sorry... I need to ask someone, as I don't know myself, but there are Clojuric wrappers for ReactNative...
Thanks for the answer. I'm sure there's a simple way to do it and it's likely just a question of syntax.
@zakwilson - Some "people I know" use this: https://github.com/seantempesta/expo-cljs-template and the docs are here: https://docs.expo.io/versions/latest/ At first look it does appear to give access to some of the Native sensors, like the Gyroscope
It also has a codified way to "Eject" and write native code, that looks as though it's really well documented...
what predicate would I use to test to see if something supports the deref function?
@idiomancy (satisfies? IDeref x)
In order to fish for this yourself, (source deref)
, then see -deref
, then (source -deref)
and you will see the protocol.
That’s a common question - it popped up some days ago too. I wonder what the pattern is that prompts it :)
Yeah, why such a recent interest in whether something can be dereffed? :thinking_face:
lol, well, its actually just a mechanistic consideration with a library/pattern I'm working on for working with reagent+posh(datascript)
its basically defining something I call a "qpv" which is essentially a reactive var that is a composition of a datascript query, a datascript pull, and one or more view functions
so, essentially the output of the whole thing is a function, but I wanted it to have a derefing syntax purely for the aesthetic notion that it should be treated as a value
so the testing to see if it was derefable was just so that I could start with a known set of ids in the pull stage without having to start with a query
essentially, the "pv" function takes a derefable (the output of the q step), but sometimes I just want to give it a value.
Run with --info or --debug option to get more log output.
error: unknown option
--debug'`
can you folks recommend a CLJS idiomatic library for doing async calls in node? Kind of like cljs-http
but for node
I used kvlt, since it depends on request
for node: https://github.com/nervous-systems/kvlt
I checked that, but wasn't the project archived?
Looking at various articles and youtube videos I noticed there was a lot of excitement about Om Next in 2016, but it’s 2018 now and it seems things with Om next are much quiet now. Anyone have any more insight on the status of the project?
not that active, though there are some users of course, it more or less works as advertised
haven’t had any time to use it myself, but I have noted some previous Om users are enjoying it quite a bit
hmm. what is '[:find ...]
vs [:find ...]
to the interpreter? Is there a predicate I can use to test for that? quoted
or something?
i suppose the question is "is there a predicate to test to see if the form is unevaluated?"
in the former the compiler will emit a vector of Clojure “inert” data, the later might not to be that simple
can clojurescript not use "nested requires" in ztellman style? [project.protocols [x :as x] [y :as y]]
happy for that limitation, as well as banning :refer :all
. keeping code readable and stuff
we recovered most of the usability over time but we left out the extravagances - which have really shown to be low in value in projects / libraries