3 ms·
If you're going to build an alternative to something, it should be easier to use. alert("Your request has succeded!"); is way easier than $.globalMes
by envex 14y ago
If you're going to build an alternative to something, it should be easier to use.
alert("Your request has succeded!");
is way easier than
$.globalMessenger().post "Your request has succeded!"
- zackbloom 14y agoWould 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.
- deleted 14y ago[deleted]