You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We shouldn't modify the d3 namespace. Since d3 has dropped d3.functor we should either drop it or replace it.
I'm not sure of the rationale, but CHANGES.md recommends creating a constant() function instead
functionconstant(x){returnfunction(){returnx;};}
and replacing each call to d3.functor with
varfx=typeofx==="function" ? x : constant(x);
(We could create dc.constant() to make it available to our users.)
Perhaps it is marginally faster because the closure holding x has no code in it. Anyway, I think we should do this the idiomatic d3 way, even though it means breaking some user code.
Alternately we could implement dc.functor(), not use it internally, and immediately deprecate it, pointing to CHANGES.md for rationale. But it seems kind of silly to break user code and give a deprecated function as a quick fix.
The text was updated successfully, but these errors were encountered:
We shouldn't modify the
d3
namespace. Since d3 has droppedd3.functor
we should either drop it or replace it.I'm not sure of the rationale, but CHANGES.md recommends creating a
constant()
function insteadand replacing each call to
d3.functor
with(We could create
dc.constant()
to make it available to our users.)Perhaps it is marginally faster because the closure holding
x
has no code in it. Anyway, I think we should do this the idiomatic d3 way, even though it means breaking some user code.Alternately we could implement
dc.functor()
, not use it internally, and immediately deprecate it, pointing to CHANGES.md for rationale. But it seems kind of silly to break user code and give a deprecated function as a quick fix.The text was updated successfully, but these errors were encountered: