@nativescript-community/ui-carto
Version:
NativeScript plugin for CARTO Mobile SDK
32 lines • 836 B
JavaScript
import { Observable } from '@nativescript/core';
export class BaseNative extends Observable {
constructor(options = {}, native) {
super();
this.options = options;
this.duringInit = false;
if (native) {
this.native = native;
}
}
initNativeView(native, options) {
this.duringInit = true;
for (const key in options) {
this[key] = options[key];
}
this.duringInit = false;
}
getNative() {
if (!this.native) {
this.native = this.createNative(this.options);
this.initNativeView(this.native, this.options);
}
return this.native;
}
createNative(options) {
return null;
}
dispose() {
this.native = null;
}
}
//# sourceMappingURL=BaseNative.js.map