is it possible to create a type-safe utility for beforeLoad?
i'm trying to create an Effect wrapper for beforeLoad (and maybe others). Basically there's just some reusable logic that i want in a wrapper, then i can just provide that directly to the beforeLoad property. i have it mostly figured out, but am unable to get inference of the function arg
e.g. (remove the effect piece for simplicity)
i'm wondering if, given the level of inference going on, is something like this even possible?
alternative is to instead wrap in an inline function and get the args from there, but wondering if this ^ is even possible
2 Replies
absent-sapphire•4w ago
no i dont think so
why dont you just call the function from beforeLoad?
sensitive-blueOP•4w ago
ah ok, thanks. yea i can, i just was hoping to create a nice util that made it minimally verbose
though now that I'm thinking of it, i'm wondering if there maybe is a way,
Effect.fn() is able to infer the options param when pass directly to beforeLoad. but i can't understand the source of that, so hard to recreate