Skip to content

Commit

Permalink
removed callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
vijay-qlogic committed Aug 31, 2018
1 parent a125079 commit 3763d72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
18 changes: 6 additions & 12 deletions samples/document-snippets/family.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -121,7 +116,6 @@ const snippets = {
// Handle the error.
});
// [END bigtable_del_family]
callback();
},
};

Expand Down
24 changes: 12 additions & 12 deletions samples/document-snippets/tests/family.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit 3763d72

Please sign in to comment.