Fork me on GitHub
#re-frame
<
2018-05-29
>
mikethompson04:05:09

Issue #1: don't use aget (this is a side issue) https://clojurescript.org/news/2017-07-14-checked-array-access Issues #2: (also a side issue) if possible it is better to use React's ref feature, rather than (.getElementById js/document "XXX") . See Reagent's /docs for how. Issues #3: Try using :component-did-mount instead of :component-will-mount ... just to remove race conditions

mikethompson04:05:49

But this a wild guess (you don't want to be rendering before the canvas element is in the DOM, particularly on figwheel reloads)

mikethompson04:05:01

@e.tmailbank ^^^

e.tmailbank04:05:48

Thanks your help! I'll read these pages

tomi.hukkalainen_slac11:05:36

Tips on making a PWA with re-frame? That is, using local storage and workers to offer a seamless app that's resilient to network problems after the initial load? I'm currently pondering whether to use re-frame-storage or the re-frame-storage-fx for persistence

tomi.hukkalainen_slac07:05:35

Both of these use the old local storage (or session storage) which can only store strings. And they don't do any serialization to bypass it, so it's a no go. I could write my own serialization, but I think I'll just try to figure out a good way to use service workers and the cache api instead, and let re-frame still think it's using plain network.

bravilogy11:05:50

@e.tmailbank shouldn’t this

:component-will-mount
    (pixi-art/load-resources!)
be
:component-will-mount
    #(pixi-art/load-resources!)
?

bravilogy11:05:02

unless it returns a closure function

thheller11:05:27

are there any re-frame example apps that use routing?

sveri11:05:04

@thheller currently undocumented, but its in place: https://github.com/sveri/closp

tord12:05:13

If you mean client-side routing, even the plain re-frame Leiningen template has that (with the +routes option).

e.tmailbank12:05:40

@tomi.hukkalainen_slac Oh, I am interested in it. More Especially, I want to create a chatbot with visual character. So, I'm learning pixijs.

alex-dixon15:05:03

Upgraded to these dependencies:

[reagent "0.8.1"]
                 [re-frame "0.10.5"]
                   [day8.re-frame/re-frame-10x "0.3.3-react16"]
Getting a warning and an errorin the console:

alex-dixon15:05:41

The first render is fine. This happens when I refresh the page

alex-dixon15:05:38

I used the popout feature and it doesn’t seem to happen when it’s embedded in the page. Also when I refresh the page when it’s popped out it seems to disconnect….shows “Host window has closed. Reopen external window to continue tracing.”

alex-dixon15:05:01

I’ve tried factory reset and clearing local storage

alex-dixon15:05:35

I can just use the ctrl +h sidebar but if I don’t have it open on page refreshes it doesn’t seem to capture any events

colindresj18:05:52

Is there some idiomatic way to clear a cached sub?

colindresj19:05:05

I’m hoping to just clear a single cached sub, not all @kenny. It’s probably not a super common use case, so I’ve no problem just dissocing from the cache. Was just wondering if there was a nicer way

kenny19:05:01

@colindresj https://github.com/Day8/re-frame/blob/master/src/re_frame/subs.cljc#L32 Lookup the reaction and call dispose! on it.