Love the library. A few times out of habbit instead of doing
var Xray = require('x-ray');
var x = Xray();
x(url, selector)(fn)...
I've found myself forgetting to call the constructor (line 2) and instead doing Xray(url, selector).... This can be a bit of a pain to debug as whatever callback you pass into the constructor is never called. Often I've thought I've parsed some strange combination of parameters and broken x-ray. As currently the constructor takes no arguments it may be useful to throw an error when arguments are passed to prevent other people from making the same mistake.
I'm not sure if calling throw from within an addon is the done thing, so if someone can outline the best way to do this then I'll write up a PR.
Love the library. A few times out of habbit instead of doing
I've found myself forgetting to call the constructor (line 2) and instead doing
Xray(url, selector)...
. This can be a bit of a pain to debug as whatever callback you pass into the constructor is never called. Often I've thought I've parsed some strange combination of parameters and broken x-ray. As currently the constructor takes no arguments it may be useful to throw an error when arguments are passed to prevent other people from making the same mistake.I'm not sure if calling
throw
from within an addon is the done thing, so if someone can outline the best way to do this then I'll write up a PR.