Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Support string as accessor? #8

Closed
bclinkinbeard opened this issue Jul 27, 2016 · 1 comment
Closed

Support string as accessor? #8

bclinkinbeard opened this issue Jul 27, 2016 · 1 comment

Comments

@bclinkinbeard
Copy link

Since plucking off a single property is likely a very common use case, it would be nice to support simply passing a string so that d3.set(stuff, 'name') would be equivalent to d3.set(stuff, x => x.name).

I'd be happy to submit a PR if this is a feature you'd accept.

@mbostock
Copy link
Member

Sorry, but I do not want to provide this convenience API; I’d rather favor parsimony and use x => x.name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants