This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws-lambda (1)
- # beginners (35)
- # cider (7)
- # cljsjs (2)
- # clojure (48)
- # clojure-austria (1)
- # clojure-conj (9)
- # clojure-dev (8)
- # clojure-india (6)
- # clojure-italy (12)
- # clojure-nl (8)
- # clojure-norway (3)
- # clojure-spec (9)
- # clojure-uk (92)
- # clojurescript (103)
- # community-development (7)
- # cursive (15)
- # datomic (75)
- # devcards (3)
- # emacs (3)
- # events (1)
- # fulcro (129)
- # hoplon (4)
- # immutant (2)
- # jobs (10)
- # leiningen (9)
- # off-topic (4)
- # onyx (2)
- # re-frame (45)
- # reagent (39)
- # reitit (40)
- # remote-jobs (4)
- # ring (2)
- # ring-swagger (9)
- # shadow-cljs (17)
- # tools-deps (31)
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. https://github.com/yogthos/memory-hole/blob/b6fcc86714b6d787118dda1fc28fe3c75d52ff52/src/cljs/memory_hole/effects.cljs#L5 https://gist.github.com/0f7a0424bcc01b9e6e1433896b22893e
@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: https://github.com/Day8/re-frame-http-fx
@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
@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.
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”.
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.
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 ... https://purelyfunctional.tv/guide/re-frame-building-blocks/
@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
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.
@mikerod you might be thinking of this: https://github.com/Day8/re-frame/blob/master/docs/SubscriptionsCleanup.md#a-final-faq
@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
@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.
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?
Open an issue if there isn’t one already and I’ll look into adding a function to call
@danielcompton actually, maybe it was a dispatch you can do programmatically to make it happen (hiding)
@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.