Fork me on GitHub
#cljsrn
<
2019-08-17
>
danielneal07:08:10

The atom has is a reference object so will have the same identity and not cause re-render. I think I use into-array with a cljs vector

Maksym13:08:21

Is there a method to import npm package? I was truing to use npm-deps, libs and foreign-libs in project.clj but none of those keys helped me I can't require package in core.cljs

danielneal13:08:14

I strongly recommend shadow cljs

danielneal13:08:57

Really helps the npm deps story

danielneal13:08:17

Check out the reagent shadow and expo demo for example

Maksym13:08:55

oh okay but if smb knows method how to do this with React Native and figwheel I'll happy to learn 😄

danielneal15:08:34

It depends. Usually add the lib to your package.json, run yarn install or npm install then require it in code using js/require <lib> You might need to add it to some other file depending on how your setup

Maksym15:08:04

I tried to do so with several packages and every attempt ended up with error Unknown named module in metroRequire 😕

lepistane09:08:54

which npm module? i've used several. u are using re-natal right? so usually you follow the stops for the npm package then https://github.com/drapanjanas/re-natal#manually-registering-dependencies-with-use-component-command

Maksym15:08:36

@U45SLGVHV oh, I did know about that, thank you for the link, I my goal was to require @mauron85/react-native-background-geolocation, but with my attempts I failed even with requiring some basic libs. Btw how would you require this module in cljs? The name starts with spec char 😕

lepistane15:08:59

(def geolocation (js/require "react-native-background-geolocation")) and then if u need class from it (def abc (r/adapt-react-class (goog-obj/get geolocation #js ["abc"]))) damn u are rich if u can pay for that module 😄 why not use others like 'geolocation' or react-native-geolocation-service ?

Maksym20:08:32

@U45SLGVHV oh man, I did not even try to use paid module, I was going to use free version from @mauron85 😄

Maksym20:08:42

and I gave up with those issues with importing and moved my project to shadow-cljs / expo stack, and expo gives me a lot of modules which is easier to import

lepistane06:08:45

nice why did you choose @mauron85/react-native-geolocation-service instead of ?