有大佬使用过 Mobx 吗?
Mobx Version:5.13.1
storage.sync.observable = action(function (object, attr, key) {
console.warn(‘`storage.sync.observable` is deprecated, use `storage.sync` instead’);
const value = storage.getItem(key);
console.log(111, object, attr, key);
if (!(Object.prototype.toString.call(value) == ‘[object Null]’ || Object.prototype.toString.call(value) == ‘[object Undefined]’)) object[attr] = value;
autorun(() => {
console.log(222, object, attr, key);
storage.setItem(key, object[attr])
});
});