Treat JS functions as regular functions in other blocks

I think that we should be able to do this:
instead of having to do this:
It would make things a lot simpler. And plus, the CALL and RUN blocks already support JS functions, so why shouldn't others?

I think the second way makes more sense, because it's implying that it's calling the javascript function. Plus, what if you need more inputs than what you would get if you just put the javascript function block in the map block?

image =

Yeah, that certainly makes sense in principle. I guess the thing that JS Function returns isn't actually a Snap! function. But there's a CALL inside MAP, right? Oh well, I'll ask Jens next time I see him (which I hope is in a week).

Oh, that should totally work, yes. Especially since it does work if you write these HOFs as custom blocks in Snap!
[edit] Ah, duh, just missing a "return" in the code, haha! Okay, fixing now, will be in dev later today. Thanks, @helicoptur, for spotting this!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.