Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
cpunion committed Jul 30, 2016
1 parent 3d8e22b commit fa0af6e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
23 changes: 23 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import ActionCable from 'actioncable'

ActionCable.getConfig = () => null
ActionCable.createWebSocketURL = (url) => {
const result = url.replace(/^http/, 'ws')
console.log(result)
return result
}
ActionCable.startDebugging()

const oldOpen = ActionCable.Connection.prototype.open
ActionCable.Connection.prototype.open = function () {
const result = oldOpen.apply(this)
this.webSocket.protocol = 'actioncable-v1-json'
return result
}

global.document = {
addEventListener () {},
removeEventListener () {}
}

export default ActionCable
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "react-native-actioncable",
"version": "0.0.1",
"description": "ActionCable for react native",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cpunion/react-native-actioncable.git"
},
"keywords": [
"ActionCable",
"react",
"native"
],
"author": "Li Jie <cpunion@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/cpunion/react-native-actioncable/issues"
},
"homepage": "https://github.com/cpunion/react-native-actioncable#readme",
"dependencies": {
"actioncable": "^5.0.0"
}
}

0 comments on commit fa0af6e

Please sign in to comment.