re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
2020-08-07T04:20:37.232800Z

does anyone know how to convert this JSX into clojurescript?

<VictoryBar
  data={sampleData}
  labelComponent={
    <VictoryTooltip
      center={{ x: 225, y: 30 }}
    />
  }
/>

[:> VictoryBar {:data sampleData
                :labelComponent [:> VictoryTooltip]}]
Doesn't work

2020-08-07T04:28:07.233200Z

@kanwei You haven't give much information about what you have done (eg where does VictoryBar come from in the hiccup you show) and what is it that doesn't work exactly. But ... my guess is that this information will help: https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md

2020-08-07T04:32:08.233900Z

@mikethompson thanks, I've read that page

2020-08-07T04:32:27.234400Z

the issue is passing a component as an attribute to another component

2020-08-07T04:33:24.234800Z

the VictoryTooltip doesn't work, also tried

:labelComponent (reagent.core/as-element [:> VictoryTooltip])

2020-08-07T04:46:34.236900Z

never mind, the latter worked

2020-08-07T04:46:45.237100Z

Yep! For re frame, the transport layer would be the events and subscriptions and entities would be the dB.

2👍
Franklin 2020-08-07T09:18:14.237700Z

Does anyone know any good table libraries to use with re-frame?

Lu 2020-08-07T09:19:28.238100Z

What features are you looking for from the table ?

Franklin 2020-08-07T09:20:23.238500Z

@lucio I'd like to easily customize the styling, search, ordering by specific columns... I'm not certain what features I might need but things like these

Franklin 2020-08-07T09:22:04.239700Z

I already am thinking of using react-table. But I wonder if there's something written in re-frame out there.

Lu 2020-08-07T09:50:15.241Z

There’s this https://github.com/armincerf/reagent-datatable .. it’s not all round finished but you can customize everything very quickly

Lu 2020-08-07T09:50:48.242100Z

You can just paste the code in your project and play with it as it’s really just a couple of namespaces

2020-08-07T10:28:20.243900Z

I wrote this a while back, but it’s not well documented. You might draw some inspiration from it though https://github.com/bdo-labs/ui/tree/master/src/cljc/ui/element/numbers

1👍
Grant Isom 2020-08-07T20:28:26.244900Z

Anyone have some solid ways to mock service calls? I want to use some flag to switch handlers to return some mocked data instead of actually hitting an endpoint.

Lu 2020-08-07T20:50:54.250400Z

@grant.isom I am not sure what you mean by solid.. but a simple if in your http events can do the job. Let me explain. With figwheel, you can use the option :closure-defines and add something like this:

{:closure-defines {your.ns/dev-mode true}
 ...}
Of course, you want to set true or false according to the type of environment. In my instance, I do it with aero, but you can do this in many different ways:
{:closure-defines {your.ns/dev-mode #profile {:dev true :prod false}}
 ...}
Then, in your code you can do:
(if your.ns/dev-mode
 "code for dev mode"
 "code for prod mode")