mirror of
https://github.com/vale981/grapher
synced 2025-03-05 09:31:42 -05:00
Add subscriptionContext to benefit the goodies of blazes onCreated.
This commit is contained in:
parent
2a99080d94
commit
43008c63a2
1 changed files with 3 additions and 2 deletions
|
@ -13,14 +13,15 @@ export default class extends Base {
|
||||||
* Subscribe
|
* Subscribe
|
||||||
*
|
*
|
||||||
* @param callback
|
* @param callback
|
||||||
|
* @param subscriptionContext
|
||||||
* @returns {null|any|*}
|
* @returns {null|any|*}
|
||||||
*/
|
*/
|
||||||
subscribe(callback) {
|
subscribe(callback, subscriptionContext = Meteor) {
|
||||||
if (this.isResolver) {
|
if (this.isResolver) {
|
||||||
throw new Meteor.Error('not-allowed', `You cannot subscribe to a resolver query`);
|
throw new Meteor.Error('not-allowed', `You cannot subscribe to a resolver query`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.subscriptionHandle = Meteor.subscribe(
|
this.subscriptionHandle = subscriptionContext.subscribe(
|
||||||
this.name,
|
this.name,
|
||||||
this.params,
|
this.params,
|
||||||
callback
|
callback
|
||||||
|
|
Loading…
Add table
Reference in a new issue