Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Ender integration, package.json & module/amd #2

merged 1 commit into from Jan 14, 2012


None yet
2 participants

rvagg commented Jan 14, 2012

Hi Scott, great little library you have here! I'm submitting this PR for your consideration, it's mainly about adding Ender support so it can be easily included in an Ender build.

  • Added a package.json so it can go in to NPM, you'll need to do an npm publish on the commandline, I've left that for you.
  • Adjusted radio.js so that it follows a generic CommonJS Module & AMD pattern but still does what it did prior to modification (the only necessary bit was to replace window with this but I thought I may as well add the whole-hog for you!).
  • Added an Ender bridge in the form of the ender.js file. This simply does the mapping from your script to the Ender ($) object. Instead of $.add() and $.remove() I went with $.subscribe() and $.unsubscribe() to avoid obvious name clashes with other Ender modules. But add and remove are still available if you access the radio object with require('radio') (a global method with Ender), so require('radio').add(x).broadcast(y).remove(x) would work the same as $.subscribe(x).broadcast(y).subscribe(x).
  • Added integration tests for Ender. The integration.html file has all the tests in it and should show all the usage possibilities when integrated with Ender. The ender.js is a simple Ender build file that was generated from that directory using ender build ../.. (path to the root directory containing package.json). When Radio is in NPM then ender build radio would generate the same file.

uxder commented Jan 14, 2012


This looks awesome. I'm merging the pull request.

Thanks for your contribution. I haven't played much with ender but will be giving it a spin.

uxder added a commit that referenced this pull request Jan 14, 2012

Merge pull request #2 from rvagg/ender
Ender integration, package.json & module/amd

@uxder uxder merged commit f31095c into uxder:master Jan 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment