statebus 7.0.10 → 7.0.11

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-library.js CHANGED
@@ -2,7 +2,6 @@
2
2
  var websocket_prefix = (clientjs_option('websocket_path')
3
3
  || '_connect_to_statebus_')
4
4
 
5
- var react_render = ReactDOM.render
6
5
  // make_client_statebus_maker()
7
6
  window.bus = window.statebus()
8
7
  bus.label = 'bus'
@@ -183,7 +182,7 @@
183
182
  headers: {accept: 'application/json'},
184
183
  signal: aborter.signal
185
184
  }
186
- ).andThen( function (x) {
185
+ ).andThen( function (new_version) {
187
186
  // New update received!
188
187
  if (subscriptions[key].status === 'connecting') {
189
188
  console.log('%c[*] opened ' + key,
@@ -196,7 +195,7 @@
196
195
  // Return the update
197
196
  t.return({
198
197
  key: key,
199
- val: add_prefixes(JSON.parse(x.body))
198
+ val: add_prefixes(JSON.parse(new_version.body))
200
199
  })
201
200
  }).catch( function (e) {
202
201
  if (subscriptions[key].status === 'aborted') {
@@ -831,9 +830,10 @@
831
830
  // We create special functions for INPUT and TEXTAREA, because they
832
831
  // have to do extra work to maintain the cursor when we use statebus
833
832
  // instead of React's setState() for state updates.
834
- bus.libs.react17.input = make_fixed_textbox('input')
835
- bus.libs.react17.textarea = make_fixed_textbox('textarea')
836
-
833
+ if (window.React && !React.createClass && window.createReactClass) {
834
+ bus.libs.react17.input = make_fixed_textbox('input')
835
+ bus.libs.react17.textarea = make_fixed_textbox('textarea')
836
+ }
837
837
  function autodetect_args (func) {
838
838
  if (func.args) return
839
839
 
@@ -981,6 +981,7 @@
981
981
  return widge(props, children)
982
982
  }
983
983
 
984
+ // var react_render = ReactDOM.render
984
985
  // window.users_widgets = users_widgets
985
986
  // function load_widgets () {
986
987
  // for (var w in users_widgets) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "statebus",
3
- "version": "7.0.10",
3
+ "version": "7.0.11",
4
4
  "description": "Synchronize state.",
5
5
  "main": "statebus.js",
6
6
  "scripts": {
package/statebus.js CHANGED
@@ -1034,6 +1034,9 @@
1034
1034
  // funk.react().
1035
1035
  //
1036
1036
  // ...which will make it re-run with the original arg1 and arg2 .
1037
+ //
1038
+ // Each subsequent time you call f(arg1, arg2), it will change the
1039
+ // remembered args and re-run the funk.
1037
1040
  function funk () {
1038
1041
  console.assert(executing_funk === global_funk
1039
1042
  || executing_funk !== funk, 'Recursive funk', funk.func)