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
Rabie 2020-07-25T02:06:39.063800Z

Hello, Is there a way to dispatch reframe events from Javascript functions in the webpage? I would like to migrate to reframe an app I made that uses google maps. When you click on a markup in gmaps a javascript event function handler is called. I would like to know if there is a way to dispatch a reframe event from theses javascript functions. Thank you

2020-07-25T04:48:25.064900Z

You could write the handler in ClojureScript and export it.

👍 1
p-himik 2020-07-25T05:38:52.065500Z

Wrap re-frame.core/dispatch in a function marked with ^:export.

👍 1
dpsutton 2020-07-25T05:49:48.066400Z

Can you easily construct keywords from js? And vectors? Or will js arrays work?

p-himik 2020-07-25T05:53:07.067Z

That wrapper can do that. And whatever else might be needed to bridge JS and re-frame.

p-himik 2020-07-25T05:55:09.067400Z

JS arrays will not work because there's an explicit check for vector?.

Rabie 2020-07-25T14:30:36.081100Z

Thank you for your answer

Rabie 2020-07-25T14:35:53.083800Z

A non related question. Has anyone worked with reframe and https://react-bootstrap.github.io/? I found some examples of integrating https://github.com/burhanloey/reagent-react-bootstrap/tree/master/src/reagent_react_bootstrap. But I was wondering, given that reframe comes with its own react (from my understanding), if it was possible to tell reframe to use react-bootsrap instead of react or if that would lead to some unwanted conflicts? Thank you

p-himik 2020-07-25T14:38:35.083900Z

re-frame doesn't come with its own React. re-frame uses Reagent, which requires React.

p-himik 2020-07-25T14:39:48.084100Z

And react-bootstrap is just a library built on top of React. If you decide to use it, it will just use React that's already used in your project.

Rabie 2020-07-25T14:43:10.084300Z

Ah ok. Thanks for clarifying @p-himik