This repository has been archived by the owner on May 8, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
updated kcdc2013 postal demo
- Loading branch information
1 parent
23ece6e
commit 0beafe8
Showing
38 changed files
with
12,592 additions
and
5,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Going postal: messaging with postal.js # | ||
# Going Postal with postal.js | ||
|
||
### Presented at KCDC 2013 | ||
|
||
In this presentation I will cover postal.js, an in-memory service bus for server- and client-side JavaScript development. I will discuss the differences between a service bus and the traditional node eventing model while demonstrating feature differences between postal.js and EventEmitter. I will then move to the browser and show how postal.js can augment client development, specifically how it works charmingly with jQuery. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/*global define*/ | ||
define(['postal'], function (postal) { | ||
'use strict'; | ||
return { | ||
global: postal.channel('global'), | ||
categories: postal.channel('categories'), | ||
search: postal.channel('search') | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
Array.prototype.contains = function (what) { | ||
var contains = false; | ||
/*global requirejs, rquire*/ | ||
'use strict'; | ||
|
||
//do a strict comparison | ||
if (typeof what !== 'function') { | ||
this.forEach(function (item) { | ||
if (contains) return; | ||
contains = (item === what); | ||
}); | ||
return contains; | ||
} | ||
|
||
//compare with an evaluator | ||
this.forEach(function (item) { | ||
if (contains) return; | ||
contains = what(item); | ||
}); | ||
return contains; | ||
}; | ||
|
||
require.config({ | ||
requirejs.config({ | ||
paths: { | ||
jquery: 'lib/jquery-1.7.2.min', | ||
underscore: 'lib/underscore', | ||
postal: 'lib/postal', | ||
diagnostics: 'lib/postal.diagnostics' | ||
'jquery': 'lib/jquery-1.9.1', | ||
'underscore': 'lib/underscore', | ||
'postal': 'lib/postal' | ||
}, | ||
shim: { | ||
'underscore': { | ||
exports: '_' | ||
} | ||
} | ||
}); | ||
|
||
require(['jquery', 'postal', 'tagCloud', 'offers', 'search'], function ($, bus) { | ||
require([ | ||
'jquery', | ||
'channels', | ||
'jqueryext', | ||
'tagCloud', | ||
'offers', | ||
'search' | ||
], function ($, channels) { | ||
$().ready(function () { | ||
bus.channel('ready').publish({}); | ||
bus.channel('categories.changed').publish(['art']); | ||
channels.global.publish({topic: 'ready'}); | ||
channels.categories.publish({ | ||
topic: 'categories.changed', | ||
data: ['art'] | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.