@@ -171,10 +171,12 @@ enabling convenient interactions with the record, including:</p>
171171<li >Retrieval of related collections</li >
172172</ul >
173173</dd >
174- <dt ><a href =" #_injectRequestHashActions " >_injectRequestHashActions(requestObject, requestHashKey)</a > ℗</dt >
175- <dd ><p >Injects actions into a request hash.</p >
176- <p >This method adds a <code >reload</code > action to the specified request hash, allowing
177- it to be reloaded using the <code >_ reloadRequest</code > method.</p >
174+ <dt ><a href =" #_injectRequestHashActions " >_injectRequestHashActions(requestObject, responseObject, requestHashKey)</a > ℗</dt >
175+ <dd ><p >Decorates the response object with actionable methods.</p >
176+ <ul >
177+ <li >Attaches a <code >reload</code > method to the <code >responseObject</code > that, when invoked,
178+ triggers a re-fetch of the original request using the stored hash key.</li >
179+ </ul >
178180</dd >
179181<dt ><a href =" #_injectCollectionReferenceKeys " >_injectCollectionReferenceKeys(collectionName, collectionRecord, [collectionRecordHashId])</a > ℗</dt >
180182<dd ><p >Injects reference keys into a collection record.</p >
@@ -252,15 +254,18 @@ a single object) and performs the following actions:</p>
252254</ol >
253255</dd >
254256<dt ><a href =" #_pushRequestHash " >_pushRequestHash(requestObject, responseObject)</a > ⇒ <code >Object</code > ℗</dt >
255- <dd ><p >Pushes a request and its corresponding response to the request hash store.</p >
256- <p >This method adds or updates a request hash in the <code >requestHashes</code > object.
257- It generates a unique <code >requestHashKey</code > using the <code >_ generateHashId</code >
258- method based on the <code >requestObject</code >.</p >
259- <p >If a request hash with the same key already exists and the <code >responseObject</code >
260- is marked as <code >isNew</code >, it updates the existing hash' ; s <code >isNew</code > flag to
261- <code >false</code >. Otherwise, it adds a new request hash with the given key and
262- <code >responseObject</code >. Additionally, it injects request hash actions using
263- the <code >_ injectRequestHashActions</code > method, enabling features like reload.</p >
257+ <dd ><p >Caches a request/response pair in the internal hash store.</p >
258+ <ul >
259+ <li >Generates a unique key based on the request and performs one of two actions:</li >
260+ </ul >
261+ <ol >
262+ <li >If the key exists and the new response is marked <code >isNew</code >, it toggles the
263+ existing entry' ; s <code >isNew</code > flag to <code >false</code >.</li >
264+ <li >Otherwise, it stores the new response object under that key.</li >
265+ </ol >
266+ <ul >
267+ <li >Also injects contextual actions (e.g., reload) into the response object.</li >
268+ </ul >
264269</dd >
265270<dt ><a href =" #setHost " >setHost(host)</a ></dt >
266271<dd ><p >Sets the host URL for the client and initializes the Axios configuration.</p >
@@ -922,19 +927,19 @@ enabling convenient interactions with the record, including:
922927
923928<a name =" _injectRequestHashActions " ></a >
924929
925- ## \_ injectRequestHashActions(requestObject, requestHashKey) ℗
926- Injects actions into a request hash.
927-
928- This method adds a ` reload ` action to the specified request hash, allowing
929- it to be reloaded using the ` _reloadRequest ` method.
930+ ## \_ injectRequestHashActions(requestObject, responseObject, requestHashKey) ℗
931+ Decorates the response object with actionable methods.
932+ * Attaches a ` reload ` method to the ` responseObject ` that, when invoked,
933+ triggers a re-fetch of the original request using the stored hash key.
930934
931935** Kind** : global function
932936** Access** : private
933937
934938| Param | Type | Description |
935939| --- | --- | --- |
936- | requestObject | <code >Object</code > | The request object associated with the hash. |
937- | requestHashKey | <code >string</code > | The key of the request hash to inject actions into. |
940+ | requestObject | <code >Object</code > | The original request configuration. |
941+ | responseObject | <code >Object</code > | The object to be decorated with actions. |
942+ | requestHashKey | <code >string</code > | The unique identifier for the request in the store. |
938943
939944<a name =" _injectCollectionReferenceKeys " ></a >
940945
@@ -1083,26 +1088,21 @@ a single object) and performs the following actions:
10831088<a name =" _pushRequestHash " ></a >
10841089
10851090## \_ pushRequestHash(requestObject, responseObject) ⇒ <code >Object</code > ℗
1086- Pushes a request and its corresponding response to the request hash store.
1087-
1088- This method adds or updates a request hash in the ` requestHashes ` object.
1089- It generates a unique ` requestHashKey ` using the ` _generateHashId `
1090- method based on the ` requestObject ` .
1091-
1092- If a request hash with the same key already exists and the ` responseObject `
1093- is marked as ` isNew ` , it updates the existing hash's ` isNew ` flag to
1094- ` false ` . Otherwise, it adds a new request hash with the given key and
1095- ` responseObject ` . Additionally, it injects request hash actions using
1096- the ` _injectRequestHashActions ` method, enabling features like reload.
1091+ Caches a request/response pair in the internal hash store.
1092+ * Generates a unique key based on the request and performs one of two actions:
1093+ 1 . If the key exists and the new response is marked ` isNew ` , it toggles the
1094+ existing entry's ` isNew ` flag to ` false ` .
1095+ 2 . Otherwise, it stores the new response object under that key.
1096+ * Also injects contextual actions (e.g., reload) into the response object.
10971097
10981098** Kind** : global function
1099- ** Returns** : <code >Object</code > - The updated or created request hash object .
1099+ ** Returns** : <code >Object</code > - The stored request hash entry .
11001100** Access** : private
11011101
11021102| Param | Type | Description |
11031103| --- | --- | --- |
1104- | requestObject | <code >Object</code > | The request object used to generate the hash key. |
1105- | responseObject | <code >Object</code > | The response object associated with the request . |
1104+ | requestObject | <code >Object</code > | The source object used to generate the hash key. |
1105+ | responseObject | <code >Object</code > | The data/state to be stored . |
11061106
11071107<a name =" setHost " ></a >
11081108
0 commit comments