@startup-booster/move-mobx
Advanced tools
Comparing version 0.1.28 to 0.1.29
@@ -5,2 +5,3 @@ const { observable } = require('mobx'); | ||
const debounce = require('lodash/debounce'); | ||
const lodashSet = require('lodash/set'); | ||
@@ -15,7 +16,9 @@ /** @type {function(string, MoveOptions): MoveMobxClient} */ | ||
const set = debounce((path, newValue) => connection.set(path, newValue), 500); | ||
const set = debounce((path, newValue) => connection.set(path, newValue), 10); | ||
connection.ref = (path, { defaultValue = undefined, previewSet = true } = {}) => { | ||
let box = observable({ value: defaultValue }); | ||
const listenCallback = newValue => (box.value = newValue); | ||
const listenCallback = newValue => { | ||
box.value = newValue; | ||
}; | ||
connection.listen(path, listenCallback); | ||
@@ -33,4 +36,5 @@ | ||
}, | ||
set(newValue) { | ||
box.value = newValue; | ||
set(key, value) { | ||
lodashSet(box.value, key, value); | ||
set(`${path}.${key}`, value); | ||
}, | ||
@@ -37,0 +41,0 @@ }; |
{ | ||
"name": "@startup-booster/move-mobx", | ||
"version": "0.1.28", | ||
"version": "0.1.29", | ||
"main": "move-mobx.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@startup-booster/move": "0.1.28" | ||
"@startup-booster/move": "0.1.29" | ||
}, | ||
@@ -9,0 +9,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5056
151
+ Added@startup-booster/move@0.1.29(transitive)
- Removed@startup-booster/move@0.1.28(transitive)
Updated@startup-booster/move@0.1.29