-
Notifications
You must be signed in to change notification settings - Fork 56
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
Expose methods as functions (bound methods) #86
Comments
@Treora yeah it would be totally doable but it would imply to possibly break the API. Which is not a bad thing considering it is more a functional library rather than a class, really. I see a few changes to operate:
Maybe the easiest move would be to:
I suppose if people want to feed it different rules, they would have to do some more work but well, it can be documented or made easier for them if needed. What do you think? |
You could opt to keep the API exactly the same if desired: you could just pass each function through If you wish to clean things up though, I would stop having
I have no strong opinion either way. |
Awesome. I almost feel guilty about having triggered such a code reorganisation effort with my tiny complaint. Thanks for your noble labour! |
No problem, it was some kind of distraction for the mind :-) |
Currently, importing a single function from a module (in ES6) like so:
fails with:
This happens because getDomain relies on
this
being thetldjs
object.To fix this, could you perhaps expose the methods as independent functions?
The text was updated successfully, but these errors were encountered: