Skip to content

Commit db4fd46

Browse files
committed
docs: update with getState()
1 parent 40f0e35 commit db4fd46

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

docs/api/observable_store.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* [ObservableStore](#ObservableStore) ⇐ <code>Observable</code>
2323
* [new ObservableStore()](#new_ObservableStore_new)
2424
* [.use(middleware)](#ObservableStore.use)
25+
* [.getState()](#ObservableStore.getState) ⇒ <code>Object</code>
2526
* [.register(action, reducer)](#ObservableStore.register)
2627
* [.query(queryName, config)](#ObservableStore.query)
2728
* [.fetch(queryName, ...args)](#ObservableStore.fetch) ⇒ <code>Promise.&lt;any&gt;</code>
@@ -73,6 +74,13 @@ const loggerMiddleware = (context) => {
7374
};
7475
CartStore.use(loggerMiddleware);
7576
```
77+
<a name="ObservableStore.getState"></a>
78+
79+
### ObservableStore.getState() ⇒ <code>Object</code>
80+
Retrieves the current state of the store. This method is crucial in asynchronous operations or event-driven environments to ensure the most current state is accessed, as the state might change frequently due to user interactions or other asynchronous updates.
81+
82+
**Kind**: static method of [<code>ObservableStore</code>](#ObservableStore)
83+
**Returns**: <code>Object</code> - - The current state of the store.
7684
<a name="ObservableStore.register"></a>
7785

7886
### ObservableStore.register(action, reducer)

site/api/observable_store/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,15 @@
783783
</span>
784784
</a>
785785

786+
</li>
787+
788+
<li class="md-nav__item">
789+
<a href="#observablestoregetstate-object" class="md-nav__link">
790+
<span class="md-ellipsis">
791+
ObservableStore.getState() ⇒ Object
792+
</span>
793+
</a>
794+
786795
</li>
787796

788797
<li class="md-nav__item">
@@ -1412,6 +1421,15 @@
14121421
</span>
14131422
</a>
14141423

1424+
</li>
1425+
1426+
<li class="md-nav__item">
1427+
<a href="#observablestoregetstate-object" class="md-nav__link">
1428+
<span class="md-ellipsis">
1429+
ObservableStore.getState() ⇒ Object
1430+
</span>
1431+
</a>
1432+
14151433
</li>
14161434

14171435
<li class="md-nav__item">
@@ -1514,6 +1532,7 @@ <h2 id="observablestore-observable">ObservableStore ⇐ <code>Observable</code><
15141532
<li><a href="#ObservableStore">ObservableStore</a><code>Observable</code><ul>
15151533
<li><a href="#new_ObservableStore_new">new ObservableStore()</a></li>
15161534
<li><a href="#ObservableStore.use">.use(middleware)</a></li>
1535+
<li><a href="#ObservableStore.getState">.getState()</a><code>Object</code></li>
15171536
<li><a href="#ObservableStore.register">.register(action, reducer)</a></li>
15181537
<li><a href="#ObservableStore.query">.query(queryName, config)</a></li>
15191538
<li><a href="#ObservableStore.fetch">.fetch(queryName, ...args)</a><code>Promise.&lt;any&gt;</code></li>
@@ -1572,6 +1591,11 @@ <h3 id="observablestoreusemiddleware">ObservableStore.use(middleware)</h3>
15721591
</span><span id="__span-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="p">};</span>
15731592
</span><span id="__span-1-4"><a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="nx">CartStore</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">loggerMiddleware</span><span class="p">);</span>
15741593
</span></code></pre></div>
1594+
<a name="ObservableStore.getState"></a></p>
1595+
<h3 id="observablestoregetstate-object">ObservableStore.getState() ⇒ <code>Object</code></h3>
1596+
<p>Retrieves the current state of the store. This method is crucial in asynchronous operations or event-driven environments to ensure the most current state is accessed, as the state might change frequently due to user interactions or other asynchronous updates.</p>
1597+
<p><strong>Kind</strong>: static method of <a href="#ObservableStore"><code>ObservableStore</code></a><br />
1598+
<strong>Returns</strong>: <code>Object</code> - - The current state of the store.<br />
15751599
<a name="ObservableStore.register"></a></p>
15761600
<h3 id="observablestoreregisteraction-reducer">ObservableStore.register(action, reducer)</h3>
15771601
<p>This method registers a reducer function for a given action type. Useful if you like redux-style reducers.</p>

site/javascripts/cami.cdn.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/javascripts/cami.cdn.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

site/sitemap.xml.gz

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)