This commit is contained in:
syuilo 2017-11-21 10:01:00 +09:00
parent c1efe0a3a4
commit c47addc973
4 changed files with 17 additions and 6 deletions

View file

@ -52,9 +52,20 @@ export default class MiOS extends EventEmitter {
*/
private swRegistration: ServiceWorkerRegistration = null;
constructor() {
/**
* Whether should register ServiceWorker
*/
private shouldRegisterSw: boolean;
/**
* MiOSインスタンスを作成します
* @param shouldRegisterSw ServiceWorkerを登録するかどうか
*/
constructor(shouldRegisterSw = false) {
super();
this.shouldRegisterSw = shouldRegisterSw;
//#region BIND
this.log = this.log.bind(this);
this.logInfo = this.logInfo.bind(this);
@ -170,7 +181,7 @@ export default class MiOS extends EventEmitter {
//#region Post
// Init service worker
this.registerSw();
if (this.shouldRegisterSw) this.registerSw();
//#endregion
};