Skip to content

Commit

Permalink
README.md: Correct onwriteend to onwrite
Browse files Browse the repository at this point in the history
- FileWriter.onwriteend will always be called, whether the write was successful or not
- FileWrite.onwrite is the correct callback to listen on successful writes
- Correct misspelling in console.log for onwrite and onerror
  • Loading branch information
GitToTheHub committed Oct 18, 2024
1 parent 92caa81 commit beed8e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ function writeFile(fileEntry, dataObj) {
// Create a FileWriter object for our FileEntry (log.txt).
fileEntry.createWriter(function (fileWriter) {
fileWriter.onwriteend = function() {
fileWriter.onwrite = function() {
console.log("Successful file write...");
readFile(fileEntry);
};
Expand Down Expand Up @@ -703,13 +703,13 @@ function writeFile(fileEntry, dataObj, isAppend) {
// Create a FileWriter object for our FileEntry (log.txt).
fileEntry.createWriter(function (fileWriter) {
fileWriter.onwriteend = function() {
console.log("Successful file read...");
fileWriter.onwrite = function() {
console.log("Successful file write...");
readFile(fileEntry);
};
fileWriter.onerror = function (e) {
console.log("Failed file read: " + e.toString());
console.log("Failed file write: " + e.toString());
};
// If we are appending data to file, go to the end of the file.
Expand Down Expand Up @@ -783,7 +783,7 @@ function writeFile(fileEntry, dataObj, isAppend) {
// Create a FileWriter object for our FileEntry (log.txt).
fileEntry.createWriter(function (fileWriter) {
fileWriter.onwriteend = function() {
fileWriter.onwrite = function() {
console.log("Successful file write...");
if (dataObj.type == "image/png") {
readBinaryFile(fileEntry);
Expand Down

0 comments on commit beed8e8

Please sign in to comment.