Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust the api to use node-style callbacks with error parameter.
- Loading branch information
1 parent
a518ccd
commit c011ea1
Showing
2 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,22 +1,21 @@ | |||
var fs = require('fs'); | var fs = require('fs'); | ||
var defer = process.nextTick; | var defer = process.nextTick; | ||
|
|
||
|
|||
exports.connect = function connect(filename, callback) { | exports.connect = function connect(filename, callback) { | ||
defer(function () { | defer(function () { | ||
callback({ | callback(null, { | ||
getStore: function getStore(name, callback) { | getStore: function getStore(name, callback) { | ||
defer(function () { | defer(function () { | ||
callback({ | callback(null, { | ||
get: function get(query, options, callback) {}, | get: function get(query, options, callback) {}, | ||
insert: function insert(data, callback) {}, | insert: function insert(data, callback) {}, | ||
update: function update(data, query, options, callback) {}, | update: function update(data, query, options, callback) {}, | ||
remove: function remove(query, options, callback) {} | remove: function remove(query, options, callback) {} | ||
}); | }); | ||
}) | }) | ||
}, | }, | ||
close: function (callback) { | close: defer | ||
defer(callback); | |||
} | |||
}); | }); | ||
}); | }); | ||
}; | }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters