-
Notifications
You must be signed in to change notification settings - Fork 124
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
ifvisible is not defined #9
Comments
Good idea! Do you have any recommendations on what to do if ifvisible is not defined? I could include a console.log() message, but I don't know if people typically want log messages (even during exceptional cases like this) to be written to the console. Perhaps I should throw an exception instead? |
I suggest to write an internal method (function (ifvisible) { .. .. .. getVisible: function() { if (typeof ifvisible === 'object') { //return the ifvisible object } else { throw 'error, warning or whatever you think'; } } .. .. })(this.ifvisible); Later on I suggest to use this internal method / wrapper inside a listen: function () { .. TimeMe.getVisible.on('...') .. } Finally you let the user start the listen method or add it to your init method. |
I put together a pull request: #11. Care to take a look at it? Thanks as always for the help. |
Looks good |
Please create a new tag like 1.1.0 |
Done! |
Please confirm that ifvisible.js was loaded before you using it. Maby you pass it via the closure:
The text was updated successfully, but these errors were encountered: