Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove argument of done callback function #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions JavaScript/Chapter 16/452-456 Making the queue reusable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
});
}

Expand Down Expand Up @@ -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();
});
}

Expand Down Expand Up @@ -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);
var update_total_queue = Queue(calc_cart_worker);
6 changes: 3 additions & 3 deletions JavaScript/Chapter 16/461-462 Making the queue skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

Expand Down Expand Up @@ -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);
var update_total_queue = DroppingQueue(1, calc_cart_worker);
6 changes: 3 additions & 3 deletions JavaScript/Chapter 17/471 How the code was changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

Expand All @@ -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);
var update_total_queue = DroppingQueue(1, calc_cart_worker);