@@ -31,6 +31,14 @@
console.log('test')
}
}, true)
+
+ Spruce.watch('application.name', () => {
+ Spruce.store('persisted').example = 'World';
+ });
+ Spruce.watch('persisted.example', () => {
+ console.log('World!');
+ })
</script>
</body>
</html>
@@ -25,10 +25,10 @@ const Spruce = {
this.updateSubscribers()
- this.disableReactivity = true
-
this.runWatchers(this.stores, target, key, value)
+ this.disableReactivity = true
try {
this.persisted.forEach(this.updateLocalStorage.bind(this))
} catch (e) {