transform and pass through the existing store

pull/1/head
ansuz 9 years ago
parent a08efc568b
commit 061cffe462

@ -8,11 +8,12 @@ var create = module.exports.create = function(filePath, backingStore) {
var file = Fs.createWriteStream(filePath, {flags: 'a+'});
return {
message: function(channel, msg, callback) {
var originalMessageFunction = backingStore.message;
backingStore.message = function(channel, msg, callback) {
message(file, msg);
backingStore.message(channel, msg, callback);
},
getMessages: backingStore.getMessages
originalMessageFunction(channel, msg, callback);
};
return backingStore;
};

Loading…
Cancel
Save