Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
But what if the message data is user specific? The data needs to be isolated per request instead of pushed into a shared store.
- Loading branch information
Michael Ridgway
committed
Nov 5, 2014
1 parent
ddeb9c8
commit 619eee3
Showing
6 changed files
with
40 additions
and
68 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
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,9 +1,16 @@ | ||
var messages = require('../data/messages'); | ||
var dispatcher = require('../lib/dispatcher'); | ||
var superagent = require('superagent'); | ||
|
||
module.exports = function () { | ||
dispatcher.dispatch({ | ||
type: 'RECEIVE_MESSAGES', | ||
messages: messages | ||
}); | ||
module.exports = function (payload, done) { | ||
superagent | ||
.get('https://rawgit.com/mridgway/10be75846faa22eb6e22/raw/') | ||
.set('Accept', 'application/json') | ||
.end(function (res) { | ||
var messages = JSON.parse(res.text); | ||
dispatcher.dispatch({ | ||
type: 'RECEIVE_MESSAGES', | ||
messages: messages | ||
}); | ||
done(); | ||
}); | ||
}; |
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.
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