Bladeren bron

chore(docs)

Ryan Chandler 5 jaren geleden
bovenliggende
commit
e04209ba97
1 gewijzigde bestanden met toevoegingen van 15 en 1 verwijderingen
  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.