|
17 | 17 | <dt><a href="#getDeferredInitTask">getDeferredInitTask()</a></dt> |
18 | 18 | <dd><p>Getter - returns the deffered init task.</p> |
19 | 19 | </dd> |
| 20 | +<dt><a href="#afterInit">afterInit(action)</a> ⇒</dt> |
| 21 | +<dd><p>Executes an action after Onyx has been initialized. |
| 22 | +If Onyx is already initialized, the action is executed immediately. |
| 23 | +Otherwise, it waits for initialization to complete before executing.</p> |
| 24 | +</dd> |
20 | 25 | <dt><a href="#getSkippableCollectionMemberIDs">getSkippableCollectionMemberIDs()</a></dt> |
21 | 26 | <dd><p>Getter - returns the skippable collection member IDs.</p> |
22 | 27 | </dd> |
@@ -54,45 +59,6 @@ to the values for those keys (correctly typed) such as <code>[OnyxCollection< |
54 | 59 | <dt><a href="#getAllKeys">getAllKeys()</a></dt> |
55 | 60 | <dd><p>Returns current key names stored in persisted storage</p> |
56 | 61 | </dd> |
57 | | -<dt><a href="#getCollectionKeys">getCollectionKeys()</a></dt> |
58 | | -<dd><p>Returns set of all registered collection keys</p> |
59 | | -</dd> |
60 | | -<dt><a href="#isCollectionKey">isCollectionKey()</a></dt> |
61 | | -<dd><p>Checks to see if the subscriber's supplied key |
62 | | -is associated with a collection of keys.</p> |
63 | | -</dd> |
64 | | -<dt><a href="#isCollectionMember">isCollectionMember(key)</a> ⇒</dt> |
65 | | -<dd><p>Checks if a given key is a collection member key (not just a collection key).</p> |
66 | | -</dd> |
67 | | -<dt><a href="#isRamOnlyKey">isRamOnlyKey(key)</a> ⇒</dt> |
68 | | -<dd><p>Checks if a given key is a RAM-only key, RAM-only collection key, or a RAM-only collection member</p> |
69 | | -<p>For example:</p> |
70 | | -<p>For the following Onyx setup</p> |
71 | | -<p>ramOnlyKeys: ["ramOnlyKey", "ramOnlyCollection_"]</p> |
72 | | -<ul> |
73 | | -<li><code>isRamOnlyKey("ramOnlyKey")</code> would return true</li> |
74 | | -<li><code>isRamOnlyKey("ramOnlyCollection_")</code> would return true</li> |
75 | | -<li><code>isRamOnlyKey("ramOnlyCollection_1")</code> would return true</li> |
76 | | -<li><code>isRamOnlyKey("someOtherKey")</code> would return false</li> |
77 | | -</ul> |
78 | | -</dd> |
79 | | -<dt><a href="#splitCollectionMemberKey">splitCollectionMemberKey(key, collectionKey)</a> ⇒</dt> |
80 | | -<dd><p>Splits a collection member key into the collection key part and the ID part.</p> |
81 | | -</dd> |
82 | | -<dt><a href="#isKeyMatch">isKeyMatch()</a></dt> |
83 | | -<dd><p>Checks to see if a provided key is the exact configured key of our connected subscriber |
84 | | -or if the provided key is a collection member key (in case our configured key is a "collection key")</p> |
85 | | -</dd> |
86 | | -<dt><a href="#getCollectionKey">getCollectionKey(key)</a> ⇒</dt> |
87 | | -<dd><p>Extracts the collection identifier of a given collection member key.</p> |
88 | | -<p>For example:</p> |
89 | | -<ul> |
90 | | -<li><code>getCollectionKey("report_123")</code> would return "report_"</li> |
91 | | -<li><code>getCollectionKey("report_")</code> would return "report_"</li> |
92 | | -<li><code>getCollectionKey("report_-1_something")</code> would return "report_"</li> |
93 | | -<li><code>getCollectionKey("sharedNVP_user_-1_something")</code> would return "sharedNVP_user_"</li> |
94 | | -</ul> |
95 | | -</dd> |
96 | 62 | <dt><a href="#tryGetCachedValue">tryGetCachedValue()</a></dt> |
97 | 63 | <dd><p>Tries to get a value from the cache. If the value is not present in cache it will return the default value or undefined. |
98 | 64 | If the requested key is a collection, it will return an object with all the collection members.</p> |
@@ -223,6 +189,20 @@ Getter - returns the default key states. |
223 | 189 | Getter - returns the deffered init task. |
224 | 190 |
|
225 | 191 | **Kind**: global function |
| 192 | +<a name="afterInit"></a> |
| 193 | + |
| 194 | +## afterInit(action) ⇒ |
| 195 | +Executes an action after Onyx has been initialized. |
| 196 | +If Onyx is already initialized, the action is executed immediately. |
| 197 | +Otherwise, it waits for initialization to complete before executing. |
| 198 | + |
| 199 | +**Kind**: global function |
| 200 | +**Returns**: The result of the action |
| 201 | + |
| 202 | +| Param | Description | |
| 203 | +| --- | --- | |
| 204 | +| action | The action to execute after initialization | |
| 205 | + |
226 | 206 | <a name="getSkippableCollectionMemberIDs"></a> |
227 | 207 |
|
228 | 208 | ## getSkippableCollectionMemberIDs() |
@@ -312,93 +292,6 @@ Deletes a subscription ID associated with its corresponding key. |
312 | 292 | Returns current key names stored in persisted storage |
313 | 293 |
|
314 | 294 | **Kind**: global function |
315 | | -<a name="getCollectionKeys"></a> |
316 | | - |
317 | | -## getCollectionKeys() |
318 | | -Returns set of all registered collection keys |
319 | | - |
320 | | -**Kind**: global function |
321 | | -<a name="isCollectionKey"></a> |
322 | | - |
323 | | -## isCollectionKey() |
324 | | -Checks to see if the subscriber's supplied key |
325 | | -is associated with a collection of keys. |
326 | | - |
327 | | -**Kind**: global function |
328 | | -<a name="isCollectionMember"></a> |
329 | | - |
330 | | -## isCollectionMember(key) ⇒ |
331 | | -Checks if a given key is a collection member key (not just a collection key). |
332 | | - |
333 | | -**Kind**: global function |
334 | | -**Returns**: true if the key is a collection member, false otherwise |
335 | | - |
336 | | -| Param | Description | |
337 | | -| --- | --- | |
338 | | -| key | The key to check | |
339 | | - |
340 | | -<a name="isRamOnlyKey"></a> |
341 | | - |
342 | | -## isRamOnlyKey(key) ⇒ |
343 | | -Checks if a given key is a RAM-only key, RAM-only collection key, or a RAM-only collection member |
344 | | - |
345 | | -For example: |
346 | | - |
347 | | -For the following Onyx setup |
348 | | - |
349 | | -ramOnlyKeys: ["ramOnlyKey", "ramOnlyCollection_"] |
350 | | - |
351 | | -- `isRamOnlyKey("ramOnlyKey")` would return true |
352 | | -- `isRamOnlyKey("ramOnlyCollection_")` would return true |
353 | | -- `isRamOnlyKey("ramOnlyCollection_1")` would return true |
354 | | -- `isRamOnlyKey("someOtherKey")` would return false |
355 | | - |
356 | | -**Kind**: global function |
357 | | -**Returns**: true if key is a RAM-only key, RAM-only collection key, or a RAM-only collection member |
358 | | - |
359 | | -| Param | Description | |
360 | | -| --- | --- | |
361 | | -| key | The key to check | |
362 | | - |
363 | | -<a name="splitCollectionMemberKey"></a> |
364 | | - |
365 | | -## splitCollectionMemberKey(key, collectionKey) ⇒ |
366 | | -Splits a collection member key into the collection key part and the ID part. |
367 | | - |
368 | | -**Kind**: global function |
369 | | -**Returns**: A tuple where the first element is the collection part and the second element is the ID part, |
370 | | -or throws an Error if the key is not a collection one. |
371 | | - |
372 | | -| Param | Description | |
373 | | -| --- | --- | |
374 | | -| key | The collection member key to split. | |
375 | | -| collectionKey | The collection key of the `key` param that can be passed in advance to optimize the function. | |
376 | | - |
377 | | -<a name="isKeyMatch"></a> |
378 | | - |
379 | | -## isKeyMatch() |
380 | | -Checks to see if a provided key is the exact configured key of our connected subscriber |
381 | | -or if the provided key is a collection member key (in case our configured key is a "collection key") |
382 | | - |
383 | | -**Kind**: global function |
384 | | -<a name="getCollectionKey"></a> |
385 | | - |
386 | | -## getCollectionKey(key) ⇒ |
387 | | -Extracts the collection identifier of a given collection member key. |
388 | | - |
389 | | -For example: |
390 | | -- `getCollectionKey("report_123")` would return "report_" |
391 | | -- `getCollectionKey("report_")` would return "report_" |
392 | | -- `getCollectionKey("report_-1_something")` would return "report_" |
393 | | -- `getCollectionKey("sharedNVP_user_-1_something")` would return "sharedNVP_user_" |
394 | | - |
395 | | -**Kind**: global function |
396 | | -**Returns**: The plain collection key or throws an Error if the key is not a collection one. |
397 | | - |
398 | | -| Param | Description | |
399 | | -| --- | --- | |
400 | | -| key | The collection key to process. | |
401 | | - |
402 | 295 | <a name="tryGetCachedValue"></a> |
403 | 296 |
|
404 | 297 | ## tryGetCachedValue() |
|
0 commit comments