@live-change/dao 0.9.138 → 0.9.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -91,4 +91,8 @@ rd.sourceSymbol = sourceSymbol
91
91
  rd.originalCredentialsSymbol = originalCredentialsSymbol
92
92
  export { sourceSymbol, originalCredentialsSymbol }
93
93
 
94
+ import DummyConnection from "./lib/DummyConnection.js"
95
+ rd.DummyConnection = DummyConnection
96
+ export { DummyConnection }
97
+
94
98
  export default rd
@@ -0,0 +1,37 @@
1
+ import WebSocket from 'universal-websocket-client'
2
+ import { ReactiveConnection } from '@live-change/dao'
3
+ import Debug from 'debug'
4
+ const debug = Debug('reactive-dao-ws')
5
+
6
+ class WebSocketConnection extends ReactiveConnection {
7
+ constructor(credentials, url, settings) {
8
+ super(credentials, settings)
9
+ this.url = url
10
+ this.initialize()
11
+ }
12
+
13
+ initialize() {
14
+ debug("TRYING CONNECT BUT OFFLINE DUMMY")
15
+ }
16
+
17
+ send(message) {
18
+ const data = JSON.stringify(message)
19
+ debug("OUTGOING MESSAGE", data, "IGNORED")
20
+ }
21
+
22
+ reconnect() {
23
+ debug("reconnect", this.url, "IGNORED")
24
+ }
25
+
26
+ dispose() {
27
+ debug("close", this.url, "IGNORED")
28
+
29
+ }
30
+
31
+ closeConnection() {
32
+ debug("closeConnection", this.url, "IGNORED")
33
+ }
34
+
35
+ }
36
+
37
+ export default WebSocketConnection
package/package.json CHANGED
@@ -35,6 +35,6 @@
35
35
  "scripts": {
36
36
  "test": "NODE_ENV=test tape tests/*"
37
37
  },
38
- "version": "0.9.138",
39
- "gitHead": "af56bfe0ca7899934a4c563ead788318832336de"
38
+ "version": "0.9.140",
39
+ "gitHead": "c350c0db4539d5f52161ff53967aa211f6f1267f"
40
40
  }