Fork me on GitHub
#re-frame
<
2017-10-23
>
royalaid16:10:01

I have a quick question about autocomplete via android

royalaid16:10:51

Re-frame doesn't seem to propagate autocompleted text entry via subscriptions

royalaid16:10:41

I am not sure if this is because the request animation frame calls are lagging behind on mobile (another problem but might be related) or that re-frame imposes some overhead causing the text value to not get set correctly

kennytilton17:10:23

Saw a claim in the SubscriptionFlow.md: “But this Signal graph must be without cycles, because cycles cause mayhem! re-frame achieves a unidirectional flow.” But I just created a cyclic subscription and it simply blew out the stack. Was there an implied “..as long as you do not do something daft.” in that claim?

kennytilton17:10:12

New question. This works:

`(re-frame/reg-sub
  ::elapsed
  (fn [query-v _]
    [re-frame.db/app-db
     (re-frame/subscribe [::time])])

  (fn [[db now avg] _]
    (- now (:start db) )))
` but I was hoping to use the :<- [sub-key]. Is there anyway I could have done that?

kennytilton17:10:18

btw, :start never changes so I do not need to subscribe.

nberger19:10:43

I sent a PR (#423) to re-frame adding a global error handler to the interceptors chain via a new reg-event-error-handler. It's useful for things like sending error details to an error service (sentry, errbit) with better granularity than window.onerror. Feedback would be appreciated. https://github.com/Day8/re-frame/pull/423

mikethompson20:10:05

@hiskennyness re-frame doesn't check for cycles. That's up to you to get right.

mikethompson20:10:50

It might be a good idea to have a [:start] subscription, instead of directly obtaining from app-db

mikethompson20:10:35

Remember this subscription (as you have written it) will run each time app-db is changed. No matter what change is made to app-db

mikethompson20:10:41

@nberger Thanks for that PR. Looks good to me. Daniel will have a further look at it today.

mikethompson20:10:31

@royalaid you haven't given enough information for any specific comment. All I can do is to make the general comment that subscriptions are about delivering data to views, and views update on the next animation frame.

nberger20:10:50

@mikethompson thanks for reviewing it. I'll add some documentation and respond to the review comments later

kennytilton21:10:34

@mikethompson That's what I suspected re cyclic subscriptions, but the doc threw me. Javelin is the same but documents the consequences of cycles. No big deal, the doc so far is great. I am a noob, will look at tuning the subscription.

royalaid22:10:01

@mikethompson, sorry let me link you on this form

royalaid22:10:25

If you try to go to it on your phone and autocomplete the autocomplete entry fails

royalaid22:10:46

The actual code for rendering that page is linked, it just the ui/text-field vector

royalaid22:10:31

It just a simple subscription that gets value out of the db