@@ -164,15 +164,15 @@ <h3 id="inputs">Properties</h3>
164
164
</ tr >
165
165
< tr >
166
166
< td class ="col-md-4 ">
167
- < code > subHeaders: < code > < a href ="../classes/StompHeaders.html " target ="_self " > StompHeaders</ a > </ code >
167
+ < code > subHeaders: < code > < a href ="../classes/StompHeaders.html " target ="_self " > StompHeaders | </ a > </ code >
168
168
</ code >
169
169
</ td >
170
170
</ tr >
171
171
172
172
173
173
< tr >
174
174
< td class ="col-md-4 ">
175
- < i > Type : </ i > < code > < a href ="../classes/StompHeaders.html " target ="_self " > StompHeaders</ a > </ code >
175
+ < i > Type : </ i > < code > < a href ="../classes/StompHeaders.html " target ="_self " > StompHeaders | </ a > </ code >
176
176
177
177
</ td >
178
178
</ tr >
@@ -189,7 +189,17 @@ <h3 id="inputs">Properties</h3>
189
189
< tr >
190
190
< td class ="col-md-4 ">
191
191
< div class ="io-description "> < p > Subscription headers, defaults to < code > {}</ code > </ p >
192
- </ div >
192
+ < p > If header information can change over time and you are allowing automatic resubscriptions,
193
+ consider using a callback as the value rather than a string literal.</ p >
194
+ < div > < pre class ="line-numbers "> < code class ="language-typescript "> * const subHeadersCallback = () => {
195
+ * return {bye: 'world'};
196
+ * };
197
+ * const sub = rxStomp.watch({ destination: queueName, subHeaders: subHeadersCallback})
198
+ * .subscribe((message) => {
199
+ * // handle message
200
+ * });
201
+ * // The subHeadersCallback will be invoked before every (re)subscription.
202
+ *</ code > </ pre > </ div > </ div >
193
203
</ td >
194
204
</ tr >
195
205
</ tbody >
@@ -307,8 +317,22 @@ <h3 id="inputs">Properties</h3>
307
317
308
318
/**
309
319
* Subscription headers, defaults to `{}`
320
+ *
321
+ * If header information can change over time and you are allowing automatic resubscriptions,
322
+ * consider using a callback as the value rather than a string literal.
323
+ *
324
+ * ```typescript
325
+ * const subHeadersCallback = () => {
326
+ * return {bye: 'world'};
327
+ * };
328
+ * const sub = rxStomp.watch({ destination: queueName, subHeaders: subHeadersCallback})
329
+ * .subscribe((message) => {
330
+ * // handle message
331
+ * });
332
+ * // The subHeadersCallback will be invoked before every (re)subscription.
333
+ * ```
310
334
*/
311
- readonly subHeaders?: StompHeaders;
335
+ readonly subHeaders?: StompHeaders | (() => StompHeaders) ;
312
336
313
337
/**
314
338
* Headers to be passed while unsubscribing, defaults to `{}`.
0 commit comments