Skip to content

Commit 7a94e77

Browse files
committed
removed callbacks
1 parent 4a96e3d commit 7a94e77

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

samples/document-snippets/family.js

+6-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Bigtable = require('@google-cloud/bigtable');
1717
const bigtable = new Bigtable();
1818

1919
const snippets = {
20-
createColmFamily: (instanceId, tableId, familyId, callback) => {
20+
createColmFamily: (instanceId, tableId, familyId) => {
2121
const instance = bigtable.instance(instanceId);
2222
const table = instance.table(tableId);
2323
const family = table.family(familyId);
@@ -32,9 +32,8 @@ const snippets = {
3232
// Handle the error.
3333
});
3434
// [END bigtable_create_family]
35-
callback();
3635
},
37-
existsFamily: (instanceId, tableId, familyId, callback) => {
36+
existsFamily: (instanceId, tableId, familyId) => {
3837
const instance = bigtable.instance(instanceId);
3938
const table = instance.table(tableId);
4039
const family = table.family(familyId);
@@ -49,9 +48,8 @@ const snippets = {
4948
// Handle the error.
5049
});
5150
// [END bigtable_exists_family]
52-
callback();
5351
},
54-
getFamily: (instanceId, tableId, familyId, callback) => {
52+
getFamily: (instanceId, tableId, familyId) => {
5553
const instance = bigtable.instance(instanceId);
5654
const table = instance.table(tableId);
5755
const family = table.family(familyId);
@@ -66,9 +64,8 @@ const snippets = {
6664
// Handle the error.
6765
});
6866
// [END bigtable_get_family]
69-
callback();
7067
},
71-
getMetadata: (instanceId, tableId, familyId, callback) => {
68+
getMetadata: (instanceId, tableId, familyId) => {
7269
const instance = bigtable.instance(instanceId);
7370
const table = instance.table(tableId);
7471
const family = table.family(familyId);
@@ -83,9 +80,8 @@ const snippets = {
8380
// Handle the error.
8481
});
8582
// [END bigtable_get_family_meta]
86-
callback();
8783
},
88-
setMetadata: (instanceId, tableId, familyId, callback) => {
84+
setMetadata: (instanceId, tableId, familyId) => {
8985
const instance = bigtable.instance(instanceId);
9086
const table = instance.table(tableId);
9187
const family = table.family(familyId);
@@ -105,9 +101,8 @@ const snippets = {
105101
// Handle the error.
106102
});
107103
// [END bigtable_set_family_meta]
108-
callback();
109104
},
110-
delFamily: (instanceId, tableId, familyId, callback) => {
105+
delFamily: (instanceId, tableId, familyId) => {
111106
const instance = bigtable.instance(instanceId);
112107
const table = instance.table(tableId);
113108
const family = table.family(familyId);
@@ -121,7 +116,6 @@ const snippets = {
121116
// Handle the error.
122117
});
123118
// [END bigtable_del_family]
124-
callback();
125119
},
126120
};
127121

samples/document-snippets/tests/family.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,27 @@ describe('Family Snippets', function() {
4949
await instance.delete();
5050
});
5151

52-
it('should create a column family', function(done) {
53-
familySnippets.createColmFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done);
52+
it('should create a column family', () => {
53+
familySnippets.createColmFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID);
5454
});
5555

56-
it('should check family exists', function(done) {
57-
familySnippets.existsFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done);
56+
it('should check family exists', () => {
57+
familySnippets.existsFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID);
5858
});
5959

60-
it('should get the family', function(done) {
61-
familySnippets.getFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done);
60+
it('should get the family', () => {
61+
familySnippets.getFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID);
6262
});
6363

64-
it('should get family metadata', function(done) {
65-
familySnippets.getMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID, done);
64+
it('should get family metadata', () => {
65+
familySnippets.getMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID);
6666
});
6767

68-
it('should set family metadata', function(done) {
69-
familySnippets.setMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID, done);
68+
it('should set family metadata', () => {
69+
familySnippets.setMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID);
7070
});
7171

72-
it('should delete family', function(done) {
73-
familySnippets.delFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done);
72+
it('should delete family', () => {
73+
familySnippets.delFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID);
7474
});
7575
});

0 commit comments

Comments
 (0)