Ryan Chandler 5 anos atrás
pai
commit
e04209ba97
1 arquivos alterados com 15 adições e 1 exclusões
  1. 15 1
      README.md

+ 15 - 1
README.md

@@ -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.