From 308d9ff9ec47f29ad9339d416e4e051754e267bb Mon Sep 17 00:00:00 2001 From: vijay-qlogic Date: Wed, 29 Aug 2018 00:14:25 +0530 Subject: [PATCH] removed callbacks --- samples/document-snippets/family.js | 18 ++++++----------- samples/document-snippets/tests/family.js | 24 +++++++++++------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/samples/document-snippets/family.js b/samples/document-snippets/family.js index 576055ed8..5ea84519d 100644 --- a/samples/document-snippets/family.js +++ b/samples/document-snippets/family.js @@ -17,7 +17,7 @@ const Bigtable = require('@google-cloud/bigtable'); const bigtable = new Bigtable(); const snippets = { - createColmFamily: (instanceId, tableId, familyId, callback) => { + createColmFamily: (instanceId, tableId, familyId) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -32,9 +32,8 @@ const snippets = { // Handle the error. }); // [END bigtable_create_family] - callback(); }, - existsFamily: (instanceId, tableId, familyId, callback) => { + existsFamily: (instanceId, tableId, familyId) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -49,9 +48,8 @@ const snippets = { // Handle the error. }); // [END bigtable_exists_family] - callback(); }, - getFamily: (instanceId, tableId, familyId, callback) => { + getFamily: (instanceId, tableId, familyId) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -66,9 +64,8 @@ const snippets = { // Handle the error. }); // [END bigtable_get_family] - callback(); }, - getMetadata: (instanceId, tableId, familyId, callback) => { + getMetadata: (instanceId, tableId, familyId) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -83,9 +80,8 @@ const snippets = { // Handle the error. }); // [END bigtable_get_family_meta] - callback(); }, - setMetadata: (instanceId, tableId, familyId, callback) => { + setMetadata: (instanceId, tableId, familyId) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -105,9 +101,8 @@ const snippets = { // Handle the error. }); // [END bigtable_set_family_meta] - callback(); }, - delFamily: (instanceId, tableId, familyId, callback) => { + delFamily: (instanceId, tableId, familyId) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -121,7 +116,6 @@ const snippets = { // Handle the error. }); // [END bigtable_del_family] - callback(); }, }; diff --git a/samples/document-snippets/tests/family.js b/samples/document-snippets/tests/family.js index e086901d6..a57e96116 100644 --- a/samples/document-snippets/tests/family.js +++ b/samples/document-snippets/tests/family.js @@ -49,27 +49,27 @@ describe('Family Snippets', function() { await instance.delete(); }); - it('should create a column family', function(done) { - familySnippets.createColmFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should create a column family', () => { + familySnippets.createColmFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID); }); - it('should check family exists', function(done) { - familySnippets.existsFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should check family exists', () => { + familySnippets.existsFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID); }); - it('should get the family', function(done) { - familySnippets.getFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should get the family', () => { + familySnippets.getFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID); }); - it('should get family metadata', function(done) { - familySnippets.getMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should get family metadata', () => { + familySnippets.getMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID); }); - it('should set family metadata', function(done) { - familySnippets.setMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should set family metadata', () => { + familySnippets.setMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID); }); - it('should delete family', function(done) { - familySnippets.delFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should delete family', () => { + familySnippets.delFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID); }); });