Skip to content

Instantly share code, notes, and snippets.

@jxson
Created April 28, 2012 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jxson/2522420 to your computer and use it in GitHub Desktop.
Save jxson/2522420 to your computer and use it in GitHub Desktop.
var secret = 'Ac-rKIcL5zjztgJEdEDLfBLyQ-gdIV'
;
var Spire = require('./spire.io.js');
var spire = new Spire({ secret: secret });
// spire.start(secret, function(err, session){
// if (err) throw err;
// })
spire.subscribe('blah', function(messages){
console.log('messages', messages);
})
$('#send').click(function(event){
console.log('clicked');
event.stopPropagation();
event.preventDefault();
spire.publish('blah', { foo: 'bar' }, function(){
console.log('message sent!');
});
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment