4 ms·
An initial config object would probably be ideal, and then you could have the chaining to supplement those values. You could have the initial method take in the
by wayfarer2s 12y ago
An initial config object would probably be ideal, and then you could have the chaining to supplement those values. You could have the initial method take in the config and use the values in that in place of the defaults. So
textures.circles()
.radius(4)
.fill("transparent")
.strokeWidth(2);
could initially be
var circles = textures.circles({
radius: 4,
fill: "transparent",
strokeWidth: 2
});
and later updated to be
circles.strokeWidth( 1 );
Which works rather nicely especially when the config object is generated dynamically.