Skip to content

Commit

Permalink
update example.js
Browse files Browse the repository at this point in the history
  • Loading branch information
leyhline committed Jun 28, 2023
1 parent d92f1fb commit 983e4ef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ let worker;
let size = 0;
progressElement.value = size;
try {
worker = await MecabWorker.create(
{ url: "../ipadic-2.7.0_bin.zip", cacheName: "ipadic-2.7.0_bin" },
(message) => {
worker = await MecabWorker.create("../ipadic-2.7.0_bin.zip", {
onLoad: (message) => {
if (size && message.total) {
size += message.size;
progressElement.value = size;
Expand All @@ -29,8 +28,8 @@ try {
progressElement.removeAttribute("value");
}
appendToLog(`load file with ${message.type}: ${message.name}`);
}
);
},
});
progressElement.value = 1;
progressElement.max = 1;
} catch (error) {
Expand Down

0 comments on commit 983e4ef

Please sign in to comment.