From ed574a706fde6639889ae841b912a06992e1dc1b Mon Sep 17 00:00:00 2001 From: YoungKi Lyu Date: Sun, 20 Nov 2022 19:45:26 +0900 Subject: [PATCH 1/2] Remove argument of done callback function --- .../Chapter 16/452-456 Making the queue reusable.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/JavaScript/Chapter 16/452-456 Making the queue reusable.js b/JavaScript/Chapter 16/452-456 Making the queue reusable.js index a3288ad..2fd8c2d 100644 --- a/JavaScript/Chapter 16/452-456 Making the queue reusable.js +++ b/JavaScript/Chapter 16/452-456 Making the queue reusable.js @@ -44,7 +44,7 @@ function Queue() { function worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } worker(cart, function() { @@ -91,7 +91,7 @@ function Queue(worker) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } @@ -130,7 +130,7 @@ function Queue(worker) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } @@ -170,8 +170,8 @@ function Queue(worker) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } -var update_total_queue = Queue(calc_cart_worker); \ No newline at end of file +var update_total_queue = Queue(calc_cart_worker); From 3910a11caf98a033216361ed6d0327c7b4c7dcec Mon Sep 17 00:00:00 2001 From: YoungKi Lyu Date: Sun, 20 Nov 2022 20:10:04 +0900 Subject: [PATCH 2/2] Remove argument of done callback function --- JavaScript/Chapter 16/461-462 Making the queue skip.js | 6 +++--- JavaScript/Chapter 17/471 How the code was changed.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/JavaScript/Chapter 16/461-462 Making the queue skip.js b/JavaScript/Chapter 16/461-462 Making the queue skip.js index 480bda9..d9a700f 100644 --- a/JavaScript/Chapter 16/461-462 Making the queue skip.js +++ b/JavaScript/Chapter 16/461-462 Making the queue skip.js @@ -32,7 +32,7 @@ function Queue(worker) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } @@ -72,8 +72,8 @@ function DroppingQueue(max, worker) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } -var update_total_queue = DroppingQueue(1, calc_cart_worker); \ No newline at end of file +var update_total_queue = DroppingQueue(1, calc_cart_worker); diff --git a/JavaScript/Chapter 17/471 How the code was changed.js b/JavaScript/Chapter 17/471 How the code was changed.js index 764aac5..d7e36c5 100644 --- a/JavaScript/Chapter 17/471 How the code was changed.js +++ b/JavaScript/Chapter 17/471 How the code was changed.js @@ -19,7 +19,7 @@ function calc_cart_total(cart, callback) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } @@ -46,8 +46,8 @@ function calc_cart_total(cart, callback) { function calc_cart_worker(cart, done) { calc_cart_total(cart, function(total) { update_total_dom(total); - done(total); + done(); }); } -var update_total_queue = DroppingQueue(1, calc_cart_worker); \ No newline at end of file +var update_total_queue = DroppingQueue(1, calc_cart_worker);