Fork me on GitHub
#re-frame
<
2020-05-28
>
colliderwriter01:05:28

can anyone recommend a re-frameable timeago library?

colliderwriter17:05:24

i might be making an obvious mistake , but when i try to build i get

The required namespace "js-jpda" is not available...

colliderwriter17:05:49

i've done

npm install @joda-js/core
and still get this error. have the underlying libraries changed?

Lu15:05:55

Did you fix the issue? If not will look into this tomorrow!

Lu15:05:55

I am using tick as underlying library, so I’ll see what’s going on there

colliderwriter17:05:27

I just uncommented it out and tried again with the same result.

The required namespace "js-joda" is not available, it was required by "java/time.cljs"

colliderwriter17:05:59

i notice that java/time is looking for "js-joda" but that package doesn't exist any more it has been replaced by js-joda/core.

colliderwriter17:05:24

(i'm new to cljs, please forgive my ignorance)

valtteri12:05:23

If your use-case is simple you can use utils from google closure library, so no external dependencies are required.

cljs.user> (require '[goog.date.relative :as gdate])
nil
cljs.user> (gdate/format (js/Date.))
"0 minutes ago"
cljs.user> (gdate/format (js/Date. "2020-05-29"))
"1 day ago"
cljs.user> 

colliderwriter21:05:13

this is for a long-lived display so i was hoping for a react component

Lu23:05:35

arco {:mvn/version "0.2.8"} should no longer have that issue 🙂. If it still does, I’ll ask the tick guys to fix it on their end @U0GFU866B

Lu00:05:31

To use a react component look at the bottom of the README.md https://github.com/luciodale/arco/blob/master/README.md#react-component

colliderwriter17:06:20

I finally got to use arco. it absolutely works as advertised. Thanks for replying to my messages.

❤️ 4
Lu08:06:46

I’m glad I helped! 🙂

lepistane15:05:59

Hello i've got a question hopefully it's not too basic so i'd like to know what users are doing in the app basically to track their behavior so basically to provide answers like 'user X spends 10% time on the menus' and something like that I wanted to create effect for each event/effect in the app that will send action to the backend but that felt wrong is there any elegant way of doing this? maybe i am thinking about this from wrong perspective should i be just using some tool for this instead of implementing my own?

aisamu16:05:30

Either way (in-house or tool), your app has to send the events somewhere. If you want to log every event "transparently" (i.e. without editing the existing handlers), I'd look into (global) interceptors

lwhorton18:05:38

these types of tools are a dime a dozen, but some are much better than others. https://www.fullstory.com/ is a personal favorite, as well as https://www.hotjar.com/ .. you can even get pretty far with google analytics ‘events’ if you set things up correctly

lwhorton18:05:14

you might consider making a reg-fx :track [... args] interface so any reg-event-fx handler that wants to track a particular event can be annotated with an interceptor. that reg-fx can call out to whatever service you decide to use. http://day8.github.io/re-frame/Interceptors/#write-an-interceptor

parrot 4
lukasz15:05:47

You definitely shouldn't implement your own - http://amplitude.com has a generous free tier for event tracking and analytics

👍 4
harishtella21:05:09

Hello all, I am wondering: How should I call a function on a js-object wrapped by a type-3 Reagent component.   Using the type-3 component from the docs as an example. https://github.com/Day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md Let’s say I want to call a function on the Google maps object that is saved in the gmap atom within the component--perhaps some other UI interaction has triggered the need for this call. How should I go about doing this?   My understanding is that all mutation of the wrapped object should come through the props of the component, which for this component is @pos. But in my case, this one time function call doesn’t map well to some state atom being passed into the component. Perhaps, I could use a state atom as a message queue of sorts to pass in commands that will get translated into function calls by the component. Does that seem like a reasonable approach?