4 ms·
Would alert = $.globalMessenger().post help? Each time you call globalMessenger() it gets a chance to do some checking to make sure it's at the right pla
by zackbloom 14y ago
Would
alert = $.globalMessenger().post
help?
Each time you call globalMessenger() it gets a chance to do some checking to make sure it's at the right place on the page and has the right classes, but if you're not doing anything fancy (like injecting it into a page which keeps getting rewritten), this should be fine.
- envex 14y agoMy main concern is the amount of typing especially when I'm just wanting to debug something with alert or console.log(). It seems like overkill for a function that's (mainly) used to debugging.
- zackbloom 14y agoThat's a miscommunication then. It's mainly for providing feedback to the user, e.g. "Document saved", "Error deleting user", "Can't connect to the server, retrying in 4", etc. For debugging, you should probably use console.log.
- lcampbell 14y agoWhy not alert = (args...) -> $globalMessenger().post args... This allows $globalMessenger to be notified for upkeep whenever the call to .post is proxied.