Fork me on GitHub
#clojure-uk
<
2019-10-14
>
danielneal10:10:09

anyone here used google firestore/google cloud functions

danielneal10:10:21

trying to figure out why my onWrite function doesn’t seem to be getting called

Wes Hall14:10:05

@danieleneal I've been looking at the platform for a bit of a toy project, but honestly still stuck trying to put together a sane project structure / build environment. Javascript land is just terrible. Shadow-cljs helps a lot, but only in helping it to suck marginally less. This is not remotely helpful, but ranting on slack is kind of my thing so... 🙂

danielneal14:10:42

it’s ok got it sorted now - was using the wrong api in the function export, which meant it was creating the function quite happily, but the trigger never got called

danielneal14:10:00

I needed

exports.pruneStatements= functions
    .firestore
    .document('/support/{supportId}')
    .onWrite((change, context) => { }

Wes Hall14:10:06

Ahhh, nice work 🙂

Wes Hall14:10:31

Oh, you're actually writing this in JS? Joining the masochistic revolution 😉

danielneal14:10:14

haha, just the cloud function bit, didn’t seem worth getting the whole cljs machinery up yet 🙂

Wes Hall14:10:10

Yeah, i've also been doing a bit of that. I kid but I actually contemplated doing the whole thing in JS myself as a means to avoid any complicated build steps, just code and push... but I forgot about JSX for react and since that requires me to have some kind of compliation / transpilation process anyway, figured I might as well get a clojurescript one working. It's just that, for the most part, the way firebase wants to do things is not the way shadow-cljs wants to do things etc etc. Also, I am the kind of guy who will spend so long figuring out a really nice build and development environment that when I finally crack it, I am bored with the project 🙂