Skip to content

Commit 5f1a5b2

Browse files
authored
Merge pull request #19 from leapfrogtechnology/test-get-id
Add isInitialized() doc
2 parents d2d2d57 + 1a5f039 commit 5f1a5b2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ const store = require('@leapfrogtechnology/async-store');
142142
app.use(store.initializeMiddleware());
143143
```
144144

145+
### isInitialized()
146+
147+
Check if the store has been initialized or not.
148+
149+
- `@returns {boolean}` - Returns either true or false.
150+
151+
```js
152+
if (store.isInitialized()) {
153+
// Do something.
154+
}
155+
```
156+
145157
### set()
146158

147159
Persists properties in the store.
@@ -177,9 +189,10 @@ const foo = store.find('foo');
177189

178190
### getId()
179191

180-
Gets the unique domain id created for the current context/scope.
192+
Gets the unique store id created for the current context/scope.
193+
Example: If used in express, it returns unique store id per request.
181194

182-
- `@returns {string | undefined}` - Returns the unique domain id.
195+
- `@returns {string | undefined}` - Returns the unique store id.
183196

184197
```js
185198
const requestIdentifier = store.getId();

0 commit comments

Comments
 (0)