add .reload()
This commit is contained in:
13
ts/index.ts
13
ts/index.ts
@ -32,7 +32,7 @@ export class Smartbrowser {
|
||||
/**
|
||||
* starts the server and returns the browserSync instance in a resolved Promise
|
||||
*/
|
||||
start (): Promise<plugins.browserSync.BrowserSyncInstance> {
|
||||
async start (): Promise<plugins.browserSync.BrowserSyncInstance> {
|
||||
let done = plugins.smartq.defer<plugins.browserSync.BrowserSyncInstance>()
|
||||
if (this.bsStatus === 'idle') {
|
||||
this.bsStatus = 'starting'
|
||||
@ -46,17 +46,18 @@ export class Smartbrowser {
|
||||
} else {
|
||||
this.bsStarted.then(() => { done.resolve(this.bsInstance) })
|
||||
}
|
||||
return done.promise
|
||||
return await done.promise
|
||||
}
|
||||
|
||||
/**
|
||||
* stops the smartbrowser instance
|
||||
*/
|
||||
stop (): Promise<void> {
|
||||
let done = plugins.smartq.defer<void>()
|
||||
async stop (): Promise<void> {
|
||||
this.bsInstance.exit()
|
||||
this.bsStatus = 'idle'
|
||||
done.resolve()
|
||||
return done.promise
|
||||
}
|
||||
|
||||
async reload (): Promise<void> {
|
||||
this.bsInstance.reload()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user