Permalink
Browse files

Minor changes

  • Loading branch information...
1 parent c42eeb3 commit ce69fc277d3b23351f763cb04ebe5a75ad949b02 Owen Barnes committed Jul 26, 2012
Showing with 4 additions and 6 deletions.
  1. +1 −1 lib/client/index.js
  2. +1 −2 lib/socketstream.js
  3. +1 −1 src/client/index.coffee
  4. +1 −2 src/socketstream.js
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -31,8 +31,7 @@ var api = exports.api = {
// Call ss.api.add('name_of_api', value_or_function) from your app to safely extend the 'ss' internal API object passed through to your /server code
add: function(name, fn) {
- var exists = false;
- if (exists == api[name]) {
+ if (api[name]) {
throw new Error("Unable to register internal API extension '" + name + "' as this name has already been taken");
} else {
api[name] = fn;
View
@@ -124,7 +124,7 @@ module.exports = (ss, router) ->
for name, client of clients
if id = options.packedAssets.id || determineLatestId(client)
client.id = id
- ss.log ''.green, "Serving client '#{client.name}' from pre-packed assets ID #{client.id}".grey
+ ss.log ''.green, "Serving client '#{client.name}' using pre-packed assets (ID #{client.id})".grey
else
ss.log '!'.red, "Unable to find pre-packed assets for '#{client.name}'. All assets will be repacked".grey
packAssets = true
View
@@ -31,8 +31,7 @@ var api = exports.api = {
// Call ss.api.add('name_of_api', value_or_function) from your app to safely extend the 'ss' internal API object passed through to your /server code
add: function(name, fn) {
- var exists = false;
- if (exists == api[name]) {
+ if (api[name]) {
throw new Error("Unable to register internal API extension '" + name + "' as this name has already been taken");
} else {
api[name] = fn;
@plievone

plievone Aug 1, 2012

ss.api.add is also a nice place to emit an event, so that other modules can listen when a service is registered and ready. Initialization is now synchronous and nice, but more complex setups might involve starting child processes etc, so even request responders, transports, clients, asset managers etc could emit events at some point. But of course for now I can simply emit events myself after calling api.add :)

0 comments on commit ce69fc2

Please sign in to comment.