瀏覽代碼

chore(docs)

Ryan Chandler 5 年之前
父節點
當前提交
e04209ba97
共有 1 個文件被更改,包括 15 次插入1 次删除
  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.