3 ms·
Personally I don't like using with prefix in builders, I was simply presenting an example from another comment. the difference, IMO, is - in Javascript - that
by peoplefromibiza 5y ago
Personally I don't like using with prefix in builders, I was simply presenting an example from another comment.
the difference, IMO, is - in Javascript - that this
// The style fetch() uses today
trig({mode: "cos", typ: "hyperbolic"})
^^^
would fail silently while
// The builder refactor
trig().mode("cos").typ("hyperbolic")(val)
would trigger a compilation error
but, IMO, passing objects is good enough most of the times, and I consider it a much better solution over passing boolean flags