Fork me on GitHub
#re-frame
<
2018-01-31
>
manuel08:01:45

@danielcompton thanks for the re-frame-trace release, it works now.

neilfigg08:01:47

Hi, I'm using cljs-ajax in a re-frame project. When POSTing using ajax.core/ajax-request (via http-xhrio) the namespace is being stripped from qualified keywords when the JSON request is sent. When using ajax.core/POST the namespaces are left intact. So

:params {:test.user.model/email ""}
is being posted as JSON
{"email:" ""}
. Is there a config option I'm missing?

danielcompton08:01:40

We use the other API in cljs-ajax

danielcompton08:01:55

I think it’s ajax-request?

neilfigg08:01:30

It's the ajax-request api that is dropping the namespaces.

damian10:01:06

Hi! Me and my team released yesterday a tiny lib that has a functionality similar to js’s Promise.all() feature. This is our first attempt to contribute to the community with code so any criticism and further guidance will be very much appreciated simple_smile https://github.com/magnetcoop/aramis

davidst12:01:07

What are routing / history libraries that work well with re-frame? I have been using accountant to manage the browser history but I am having some trouble with scroll restoration. (It doesn't scroll to top when navigating to a new page and it doesn't properly restore the scroll position when pages have different heights.) Are there examples that deal with this issue? Ideally I would also like the location hash to act like in plain html (jump to anchor on page).

oliy15:01:49

@davidst we use pushy with bidi

oliy15:01:41

pushy does the url/html5history stuff, and you give it a callback to bidi which resolves the url and parameters, and then we push that into re-frame

joelsanchez16:01:01

@davidst I use bidi with accountant and I don't have those issues

davidst16:01:47

pushy seems to do roughly the same as accountant

davidst16:01:57

it's a bit silly but let me describe one of the issues: if I scroll down and click on a link that is handled by accountant/pushy then the new page loads (as desired) but the scroll position is maintained (not desired; it should scroll to the top of the page)

joelsanchez16:01:52

I'd try: - to force full re-rendering on route change (by assigning a key with gensym to the root component). see if that fixes the issue, and if it does, find a better way - to simply use the JS call for scrolling to the top, every time the route changes

davidst17:01:01

Right now I make JS calls to scroll to the top when a new page loads. However it is not quite the right behavior. If the new page loads because of a popstate event (back button), the previous scroll position should be restored (at least that's the vanilla html behavior). I was hoping that there is a library that works with re-frame and more faithfully sticks to the navigation behavior for plain html

jvuillermet17:01:42

Had the same requirement and opted for @joelsanchez1st point but it still doesn’t solve the popstate issue

joelsanchez17:01:32

you could try to save the scroll position before a route change and then have a listener for popstate events, and apply that scroll position...or smth