B
B
bormor2017-08-04 08:58:14
Building projects
bormor, 2017-08-04 08:58:14

gulp. Why is a callback needed in a task?

Sometimes in gulpfile I meet such a construction:

gulp.task("build", function(cb) {
  run(
    "clean",
    "copy",
    "style",
    "images",
    "js",
    cb
  );
});

Why is a callback needed here? In what situations does it apply?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2017-08-04
@bingo347

Gulp allows you to chain tasks into dependency chains (before task A, you need to execute B), the callback tells gulp that the task is completed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question