Skip to content

Commit b7936f2

Browse files
committed
chore(index): Remove done callback again
1 parent 6327494 commit b7936f2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

core/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,10 @@ const patternlab_module = function (config) {
264264
/**
265265
* build patterns, copy assets, and construct ui
266266
*
267-
* @param {function} callback a function invoked when build is complete
268267
* @param {object} options an object used to control build behavior
269268
* @returns {Promise} a promise fulfilled when build is complete
270269
*/
271-
build: function (callback, options) {
270+
build: function (options) {
272271
if (patternlab && patternlab.isBusy) {
273272
logger.info('Pattern Lab is busy building a previous run - returning early.');
274273
return Promise.resolve();
@@ -282,21 +281,20 @@ const patternlab_module = function (config) {
282281
this.events.on('patternlab-pattern-change', () => {
283282
if (!patternlab.isBusy) {
284283
options.cleanPublic = false;
285-
return this.build(callback, options);
284+
return this.build(options);
286285
}
287286
return Promise.resolve();
288287
});
289288

290289
this.events.on('patternlab-global-change', () => {
291290
if (!patternlab.isBusy) {
292291
options.cleanPublic = true; //rebuild everything
293-
return this.build(callback, options);
292+
return this.build(options);
294293
}
295294
return Promise.resolve();
296295
});
297296

298297
patternlab.isBusy = false;
299-
callback();
300298
});
301299
},
302300

@@ -312,19 +310,17 @@ const patternlab_module = function (config) {
312310
/**
313311
* build patterns only, leaving existing public files intact
314312
*
315-
* @param {function} callback a function invoked when build is complete
316313
* @param {object} options an object used to control build behavior
317314
* @returns {Promise} a promise fulfilled when build is complete
318315
*/
319-
patternsonly: function (callback, options) {
316+
patternsonly: function (options) {
320317
if (patternlab && patternlab.isBusy) {
321318
logger.info('Pattern Lab is busy building a previous run - returning early.');
322319
return Promise.resolve();
323320
}
324321
patternlab.isBusy = true;
325322
return buildPatterns(options.cleanPublic).then(() => {
326323
patternlab.isBusy = false;
327-
callback();
328324
});
329325
},
330326

@@ -375,7 +371,7 @@ const patternlab_module = function (config) {
375371
*/
376372
serve: function (options) {
377373
options.watch = true;
378-
return this.build(() => {}, options).then(function () {
374+
return this.build(options).then(function () {
379375
serve(patternlab);
380376
});
381377
},

0 commit comments

Comments
 (0)