@expressive/mvc 0.26.0 → 0.27.0

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/lib/index.esm.js CHANGED
@@ -902,12 +902,14 @@ function use(input, argument) {
902
902
  }
903
903
  function manage(next) {
904
904
  const methods = {
905
- on(key, callback) {
905
+ on(key, event) {
906
+ const callback = () => event(next[key], key);
906
907
  if (!(key in next))
907
908
  control.watch(key, { value: subject[key] });
909
+ callback();
908
910
  return control.addListener(k => {
909
911
  if (k === key)
910
- return () => callback(next[key], key);
912
+ return callback;
911
913
  if (typeof k !== "string")
912
914
  return k;
913
915
  });
package/lib/index.js CHANGED
@@ -906,12 +906,14 @@ function use(input, argument) {
906
906
  }
907
907
  function manage(next) {
908
908
  const methods = {
909
- on(key, callback) {
909
+ on(key, event) {
910
+ const callback = () => event(next[key], key);
910
911
  if (!(key in next))
911
912
  control.watch(key, { value: subject[key] });
913
+ callback();
912
914
  return control.addListener(k => {
913
915
  if (k === key)
914
- return () => callback(next[key], key);
916
+ return callback;
915
917
  if (typeof k !== "string")
916
918
  return k;
917
919
  });
package/package.json CHANGED
@@ -26,6 +26,6 @@
26
26
  "prebuild": "rm -rf lib/",
27
27
  "preversion": "npm run test && npm run build"
28
28
  },
29
- "version": "0.26.0",
30
- "gitHead": "195aa8bd3fe81efd5f15a5a188854ab35e211fb9"
29
+ "version": "0.27.0",
30
+ "gitHead": "be665195493e16204f20d78ca3cb4d4d91eb0f84"
31
31
  }