Skip to content

Commit fde2703

Browse files
committed
Favor yield/return over write/close
1 parent 5da6e3b commit fde2703

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs-common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ CommonFs.prototype.write = function (path, content, flags, charset, options) {
7777
}
7878
options.flags = flags;
7979
return self.open(path, options).then(function (stream) {
80-
return stream.write(content).then(function () {
81-
return stream.close();
80+
return stream.yield(content).then(function () {
81+
return stream.return();
8282
});
8383
});
8484
};
@@ -111,8 +111,8 @@ CommonFs.prototype.append = function (path, content, flags, charset, options) {
111111
}
112112
options.flags = flags;
113113
return self.open(path, options).then(function (stream) {
114-
return stream.write(content).then(function () {
115-
return stream.close();
114+
return stream.yield(content).then(function () {
115+
return stream.return();
116116
});
117117
});
118118
};

0 commit comments

Comments
 (0)