From 52ff6966f844299cb4009cd963bcee8cb7e4852d Mon Sep 17 00:00:00 2001 From: Spartak Date: Sat, 30 May 2020 14:53:14 +0300 Subject: [PATCH] rename passFirst to skipFirst --- src/orm/hasura.js | 8 ++++---- tests/subscription.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/orm/hasura.js b/src/orm/hasura.js index 7471e37..51ef44e 100644 --- a/src/orm/hasura.js +++ b/src/orm/hasura.js @@ -436,7 +436,7 @@ class Hasura { async subscribeToMore(parameters, callback, settings = {}) { settings = __.mergeDeep( { - passFirst: false, + skipFirst: true, }, this.params.query, settings, @@ -444,15 +444,15 @@ class Hasura { callback(await this.query(parameters, settings)); - let firstPassed = settings.passFirst; + let skippedFirst = !settings.skipFirst; const subSettings = __.mergeDeep({}, this.params.subscribe, settings); return this.subscribe( parameters, (response) => { - if (firstPassed === true) { + if (skippedFirst === true) { callback(response); } else { - firstPassed = true; + skippedFirst = true; } }, subSettings, diff --git a/tests/subscription.js b/tests/subscription.js index 29ed8ba..e116ab3 100644 --- a/tests/subscription.js +++ b/tests/subscription.js @@ -294,7 +294,7 @@ test.serial('subscribe to more works', (t) => { }); }); -test.serial('subscribe to more firstPass', (t) => { +test.serial('subscribe to more skipFirst', (t) => { t.timeout(2000); let events = 0; const orm = t.context.orm; @@ -312,7 +312,7 @@ test.serial('subscribe to more firstPass', (t) => { if (events === 2) resolve(); }, { - passFirst: true, + skipFirst: false, }, ); t.true(typeof unsub === 'function');