Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return how much words was selected #16

Closed
felquis opened this issue Jan 15, 2015 · 0 comments
Closed

Return how much words was selected #16

felquis opened this issue Jan 15, 2015 · 0 comments

Comments

@felquis
Copy link
Contributor

felquis commented Jan 15, 2015

selecting(document, function(selector, otherInfos) {
  console.log(otherInfos.wordCount);
});

I think this is useful, to avoid the programar to write more code in the callback.

It'd be something like

selecting(document, function(selector) {
  console.log(selector.split(' ').length);
});

The first proposed solution, is so much elegant.

@EvandroLG what you think about a second parameter? Or, just transform the first parameter to a object, with a lot of helpful information.

selecting(document, function(selected) {
  console.log(selected.text);
  console.log(selected.wordCount);
});

Etc... would be awesome!

EvandroLG added a commit that referenced this issue Jan 16, 2015
Add wordCount property closes #16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant