statebus 6.1.20 → 6.1.21

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/client.js CHANGED
@@ -37,7 +37,7 @@
37
37
  // link.href = url
38
38
  // url = link.href
39
39
  // }
40
- console.log('opening websocket to', url)
40
+
41
41
  return new WebSocket(url + '/' + websocket_prefix + '/websocket')
42
42
  // return new SockJS(url + '/' + websocket_prefix)
43
43
  }
@@ -453,11 +453,10 @@
453
453
  window.ignore_flashbacks = false
454
454
  if (statebus_server !== 'none') {
455
455
  if (clientjs_option('braid_mode')) {
456
- console.log('We socket-free!')
456
+ console.log('Using Braid-HTTP!')
457
457
  braid_http_mount ('/*', statebus_server)
458
458
  } else {
459
459
  bus.net_mount ('/*', statebus_server)
460
- console.log('We going websocket!')
461
460
  }
462
461
  }
463
462
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "statebus",
3
- "version": "6.1.20",
3
+ "version": "6.1.21",
4
4
  "description": "Synchronize state.",
5
5
  "main": "statebus.js",
6
6
  "scripts": {
package/statebus.js CHANGED
@@ -10,10 +10,12 @@
10
10
  // Fetch, Save, Forget, Delete
11
11
 
12
12
  function fetch (key, callback) {
13
+ if (typeof key !== 'string'
14
+ && !(typeof key === 'object' && typeof key.key === 'string'))
15
+ throw ('Error: fetch(key) called with key = '
16
+ + JSON.stringify(key))
13
17
  key = key.key || key // You can pass in an object instead of key
14
18
  // We should probably disable this in future
15
- if (typeof key !== 'string')
16
- throw ('Error: fetch(key) called with a non-string key: '+key)
17
19
  bogus_check(key)
18
20
 
19
21
  var called_from_reactive_funk = !callback