Fork me on GitHub
#re-frame
<
2019-10-24
>
superstructor09:10:22

@kristian507 re-frame-template has an example of using lein profiles to support this with shadow-cljs, but yep requires lein: https://github.com/day8/re-frame-template/blob/master/src/leiningen/new/re_frame/project.clj#L54

khellang11:10:58

Thanks! Yeah, I was hoping to avoid lein or deps.edn 🙂

superstructor12:10:35

@kristian507 @U05224H0W has since commented at https://github.com/day8/re-frame-debux/issues/21#issuecomment-545858409 It would require me to do a new project or a shadow-cljs-specific ns I think for re-frame-debux (e.g. re-frame-debux-shadow-cljs maybe). So not available yet but I am thinking about it and will get it done soonish.

thheller12:10:26

you can just include the stub namespace and use the reverse logic. so it is enabled by default and disabled by including :ns-alias {da8.re-frame.tracing day8.re-frame.tracing-stubs} for :release

thheller12:10:48

less effort and just one extra namespace that will be otherwise unused

Pavel KlavĂ­k11:10:11

Hi, I would like to add animation library react-spring to my re-frame project. What is the best way to deal with separate state of animation objects, compared to reframe DB atom?

superstructor12:10:29

What do you mean by 'state of animation objects' exactly ?

superstructor12:10:36

If you mean e.g.

(let [props (use-spring #js {:opacity 1 :from #js {:opacity 0}})]...
Does that work if you just use a form-2 for form-3 component and pass the props into a stye attribute ? Ref https://www.react-spring.io/docs/hooks/basics https://github.com/reagent-project/reagent/blob/master/doc/CreatingReagentComponents.md http://reagent-project.github.io/docs/master/reagent.core.html#var-create-class

Pavel KlavĂ­k12:10:05

basically, the spring object is keeping its local state which is used to update the style of a component, and on the other hand, I have reframe DB atom where all the state is stored

Pavel KlavĂ­k12:10:49

to give some example, suppose that my website consists of a div element with absolute position and I am recieving msgs from the server changing the position, and I want to add animation which slides the element to the new position.

Pavel KlavĂ­k12:10:20

currently, I have position in reframe DB and it will cause subscriptions to rerender when the position is updated (with no animation)

Pavel KlavĂ­k12:10:40

should I store in DB the new position and the old position separately and let the react-spring to do the animation? and what happens when another position is received while animation is running?

p-himik13:10:50

I would not store animation state in the DB. I don't view current animation progress as part of an application's state. At least, that's how it is usually - I have no idea what actually goes on in your app.

Pavel KlavĂ­k16:10:34

Makes sense, I will start with a simple experiment placing the object in a view and later will see whether some of these objects need to be stored in DB, so I can do some computations with them.

johanatan23:10:11

hi, does anyone know if order of dispatches is preserved? if i do:

(rf/dispatch [:event1 ...])
(rf/dispatch [:event2 ...])
am I guaranteed that event1 will have been handled before event2 is?

johanatan18:10:04

đź‘Ť thx!