Skip to content

Commit

Permalink
Added event inheritance in the 'VirtualStoredFile' class
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed Jun 4, 2017
1 parent 7506c3c commit eaefedc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/resource/virtualStored/VirtualStoredFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ var VirtualStoredFile = (function (_super) {
_this.updateLastModified();
_this.len = size;
});
function emit(name) {
wr.on(name, function (_1, _2) { return w.emit(name, _1, _2); });
}
emit('close');
emit('error');
emit('finish');
callback(null, wr);
});
};
Expand Down
9 changes: 9 additions & 0 deletions src/resource/virtualStored/VirtualStoredFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ export class VirtualStoredFile extends VirtualStoredResource
this.updateLastModified();
this.len = size;
})

function emit(name : string)
{
wr.on(name, (_1, _2) => w.emit(name, _1, _2));
}
emit('close');
emit('error');
emit('finish');

callback(null, wr);
});
}
Expand Down

0 comments on commit eaefedc

Please sign in to comment.