Fork me on GitHub

@lilactown ah right, that's a public API of Reagent, but I see what you mean


Can someone tell me why re-frame is treating ‘:http’ as an effect within my function? Error - “re-frame: no handler registered for effect: ” :http “. Ignoring.” Edit: well now i see reg-ex :http created in the memory hole project. I suppose a better question is where would a new programmer focus to even learn he needs to do these things? I’ve been guarded by rails for years so really getting to the bare metal of things is interesting.


@decim For any reg-event-fx, it will perform all of the fxs in the hash-map. For example yours has the fx --> :http ... so somewhere, there needs to be a reg-fx for :http. Most people use this:


@gadfly361 I see so you can next effects in a sense. Now i’m tackling the bit of code I saw in the memory hole project. I also noticed http-xrhio in the re-frame documentation. Is that in any way similar to what yogthos wrote? Newbie questions… i’m biting more than I can chew clearly.


Not sure where in the re-frame documentation you're looking, but fairly safe to assume it was referring to the aforementioned library because it does indeed expose the :http-xhrio fx


@decim yeah, similar to what is in memory hole


@decim Haha that is the link I sent you 😂


But yes, I think that is what you are after :) I think most people use it


@gadfly361 lol, i’m lost all around. i’ll have to come back to this in a few hours. i’m all over the place looking for examples


but i believe i did take a few good steps forward. i’m getting new errors now along the lines of ‘cannot write’. i’ll take that as a step in the right direction.


@decim As long as the error I am getting is changing I am happy. 🙂

❤️ 4

In reframe, I seem to have a lot of events functions that do the same thing. Is it better or possible to write a generic function to handle update events and pass in the data it needs to do the update as function parameters?


Currently I’m updating data in a map, but I have an event handler for each update. It seems like I could have a single event handler that just takes the location in the map and the new value.


@scott.archer I don’ think that it is bad to parameterize event handlers. However, it is not likely a good idea to expose app db structure externally as the arguments to the event handler. Your event handlers should convey their intent at a higher-level than “update the db at this path”.


this is written in some docs somewhere for re-frame, but I can’t find it


Thanks @mikerod that makes a lot of sense. Even though there’s a good bit of repetition, it gives you some separation from the DB implementation to what you are trying to do / update.


@scott.archer yeah, maybe if you don’t need to expose path info and can make the event names used convey user intent, you may be able to help with some of the redundancy by sharing a handler. It is just something you have to be cautious about overdoing and exposing db details out through the handlers


I think I can get away with having 1 handler per “map” in the database instead of one per field.


I don’t think for this application it would cause any issues.


I only have a few high level maps used for configuration data.


Is there a recommended way to close the re-frame 10x panel from JS? Or to prevent it from starting opened? I'm running Selenium tests and the panel gets in the way.


@scott.archer have a read through the first few pages of these docs ... where the discussion is about "user intent" etc ...

👍 4

@mikethompson I was looking all over for something (I think that) you wrote before. It showed some pattern of trying to be clever and abstract/parameterize a handler (subs or event, don’t remember) too much, but then urges not to do that in the name of making clear intent and not coupling to the db layout etc.


but none of my searching for it has worked. I’ve read this above link before too, but didn’t think that was the same thing I was remembering

Nick Stares17:06:23

Hey, I wanted to report some information (as per the suggestion in the README) about the expansion triangles bug in re-frame-10x. It happens to me reliably whenever I refresh the page while 10x is open in a detached window. I can fix it by clearing out my local storage, but I have to repeat that every time I accidentally refresh while 10x is open.


@mikethompson that is exactly what was in my mind. I even know it said “dry”, but it turns out it says “DRYYYY” and I guess GitHub search doesn’t do prefix matching

😂 4

@mikethompson per my question above... what would you recommend for closing 10x programmatically? I'm running tests in IE 10 (yes... have pity). Sending CTRL-H to the browser opens an IE help drawer. Could 10x export a function which dispatches [:settings/show-panel? false]? Or have a button that closes the panel (which might be good for accessibility/discoverability anyway)?


@danielcompton see immediately above. Can you tell us again the special programmatic incantation pls.


I thought there was a function exported for this, but I can't see one


Probably adding the localstorage key to your tests would be best way of making sure it doesn't show up


@danielcompton So open the app (to get the right domain), set the show-panel localstorage key to "false" and reload the app?


That doesn’t sound so easy does it? :)


Open an issue if there isn’t one already and I’ll look into adding a function to call


There was an API incantation


@danielcompton actually, maybe it was a dispatch you can do programmatically to make it happen (hiding)




I know you have supplied it previously


Yeah that might have been it. A bit ugly though


@danielcompton not so easy, but not the grossest thing I've tried. And best of all it works! I had considered a trick like exporting my own function which called mranderson.../dispatch, but decided against it because I'd need to :require [mranderson...]. Since mranderson is a dev-only dependency, I'd rather keep it out of my production code. Anyway, I'll open a PR. Thanks for the response, and @mikethompson thanks to you too.


@mikethompson Perhaps you were thinking of the trick mentioned in this Issue:


Yeah, that's the one. Hmm. But that's a toggle.


@mikethompson @danielcompton Here's a Pull Request for opening or closing the panel programmatically: