|
@@ -107,4 +107,18 @@ To access the `name` property, you can do the following inside of your component
|
|
|
</div>
|
|
|
```
|
|
|
|
|
|
-The `<span>` will now have "Amazing Alpine Application" set as its `innerText`.
|
|
|
+The `<span>` will now have "Amazing Alpine Application" set as its `innerText`.
|
|
|
+
|
|
|
+### Modifying state from outside of Alpine
|
|
|
+
|
|
|
+You can modify your global state from external scripts using the `Spruce` object:
|
|
|
+
|
|
|
+```javascript
|
|
|
+Spruce.store('application', {
|
|
|
+ name: 'Amazing Alpine Application'
|
|
|
+})
|
|
|
+
|
|
|
+Spruce.stores.application.name = 'Amazing Spruce Integration'
|
|
|
+```
|
|
|
+
|
|
|
+This will trigger Alpine to re-evaluate your subscribed components and re-render.
|