Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor changes

  • Loading branch information...
commit ce69fc277d3b23351f763cb04ebe5a75ad949b02 1 parent c42eeb3
Owen Barnes owenb authored
2  lib/client/index.js
View
@@ -128,7 +128,7 @@ module.exports = function(ss, router) {
client = clients[name];
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;
3  lib/socketstream.js
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;
2  src/client/index.coffee
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
3  src/socketstream.js
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 added a note

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 :)

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

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 :)

Please sign in to comment.
Something went wrong with that request. Please try again.