Skip to content

Commit

Permalink
change ./lib/app-sock/dup.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiduca committed Jan 12, 2015
1 parent 931bb60 commit bb240cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

example react.js app (with sockjs)

## prepare

set your Twitter API in `./.config.json`

## run

```
Expand Down
12 changes: 10 additions & 2 deletions lib/app-sock/dup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ util.inherits(Dup, stream.Duplex)

module.exports = Dup

Dup.prototype._write = function (data, enc, done) {
this.push(JSON.stringify(data))
Dup.prototype._write = function (_data, enc, done) {
var data
try {
data = JSON.stringify(_data)
} catch (err) {
cnosole.error(err)
return done(err)
}

this.push(data)
done()
}
Dup.prototype._read = function () {}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-tweets",
"version": "0.0.1",
"version": "0.0.2",
"description": "React Example",
"main": "app.js",
"dependencies": {
Expand Down

0 comments on commit bb240cb

Please sign in to comment.