Fork me on GitHub

@danielcompton Hi, We can use Reagent. In React Native, things you can use are all React component, these component are mapping to the real native elements. at the entry of program, call React Native API to register a component(a plan React component) instead of rendering it to a dom node.


I think re-frame-10x should work properly, because it already be used in status-im project. It must be I missed something important I think.


K, we don't use RN at all at Day8 so will probably need help from outside for any changes to support it better


I want to read value from db once in component init, then subscribe with param calculated based on first value. So should I do it like this:

(defn my-comp []
  (let [first-value @(rf/subscribe [:first-value])]
    (fn []
      (let [computed-subscription @(rf/subscribe [:second first-value])] 


Oh, I’ve forgotten about reg-sub-raw


Is it considered common to use subscriptions not in components, but in events? To use them as like sort of “cursors” into my data?


if you do, you'll probably need to use to make sure the subscription clean up happens properly


How can I enable jQuery/Bootstrap for my application? I keep getting the error Bootstrap's JavaScript requires jQuery. I've tried including jQuery before the Bootstrap JS, but it doesn't help.


@danielcompton any suggestion to debug where is going wrong? by watching the frames of websockt(re-frisk-remote server), I know the trace data has been sent correctly. I want to investigate this problem.


Hey all, just made re-pollsive: a library to handle polling events for re-frame

🎉 12
👍 4

I'm trying to think of a way to show a loading indicator if :loading is set longer than 500 and if it shows at all then show it for at least 1500 ms. Any ideas on how to do this the re-frame way?


oh, that looks like it will help


Anyone know if a negative number is fine in the ms? will that just dispatch immediately?


@matthewdaniel it is an impl detail that isn’t documented, but looks like the ms arg goes through to js/setTimeout


Isn’t 0 more common for the case you are saying?


It isn’t truly immediate, but it is “soon” etc


ie something like:

If this parameter is omitted, a value of 0 is used, meaning execute "immediately", or more accurately, as soon as possible.
via doc on delay arg.


I'm getting a lot of render false {:loading? false, :error nil, :choices [], :id 0, :timer nil} in the console log, when using re-com's single-dropdown component. Some deep reagent callstack behind it, which doesn't tell me much. Has anyone seen this?


i’ve been concocting an “event blocker” interceptor and I wanted to get some feedback if anyone’s interested… is this a stupid idea? is there a much better way to do this?


the use case is a user is working on a multi-part form, or something complicated where they don’t want to lose lots of input if accidentally/intentionally clicking away. it’s essentially the canonical “are you sure you want to leave the page without saving?” message, done via an interceptor


i guess a problem with this implementation is that :allowed-these-events can grow really large, particularly if there’s background tasks… at which point it’s almost useless if you have an async handler return at some point, or a websocket connetion spewing events, etc. hmm.


i think it would be more helpful to have a :catch-these-events almost like the re-frame-forward-events lib, but instead of “see this event and then do that”, it should “see this event - kill it, and do this instead”.


What is the idiomatic way to structure a app state when editing elements. So I have a list of users and want to edit one. I see two posibilities: 1. add the id to edit to the app state like so: {:users {:edit 23 :all [....]}} 2. add the user map that should be edited into the app state: {:users {:edit {:name "foo" :id 23} :all [....]}}


I think that article: answered my question 🙂

👍 16

@mikerod @matthewdaniel Annoyingly, if you setTimeout with 0, it will still be 3ms to 4ms.


@mikethompson yep “as soon as possible” hah