Ah, got it.
I probably would have implemented with a curried function.
const createFoo = wow => (data: PayLoad) => { const metric = wow(data.x); ... }
in the regular place I'd use
foo = createFoo(wowGlobal);
and for testing something different, but I guess your way works too, it's just a bit more implicit.
To be annoyingly pedantic, createFoo above is not a curried function, because it can't be called like createFoo(wow, data) and like createFoo(wow, data) at the same time, it's a higher order function with aurity of 1
I allow it!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ah, got it.
I probably would have implemented with a curried function.
in the regular place I'd use
and for testing something different, but I guess your way works too, it's just a bit more implicit.
To be annoyingly pedantic, createFoo above is not a curried function, because it can't be called like createFoo(wow, data) and like createFoo(wow, data) at the same time, it's a higher order function with aurity of 1
I allow it!