@@ -28,12 +28,8 @@ function updateOptions(data) {
hooks.fire(data);
}
-function onReady(cb) {
- ready.then(cb);
-}
-
export default {
- ready: onReady,
+ ready,
get: getOption,
set: setOption,
update: updateOptions,
@@ -35,7 +35,7 @@ export default {
},
created() {
- options.ready(() => {
+ options.ready.then(() => {
this.value = options.get(this.name);
this.revoke = hookSetting(this.name, (value) => {
this.value = value;
@@ -9,7 +9,7 @@ import './style.css';
Vue.prototype.i18n = i18n;
document.title = `${i18n('labelInstall')} - ${i18n('extName')}`;
-options.ready(() => {
+options.ready.then(() => {
const el = document.createElement('div');
document.body.appendChild(el);
new Vue({
@@ -22,7 +22,7 @@ initialize();
function initialize() {
initMain();
@@ -18,7 +18,7 @@ options.hook((data) => {
Vue.set(store, 'features', features);
});
-options.ready(() => reset('sync'));
+options.ready.then(() => reset('sync'));
function reset(version) {
if (objectGet(store, 'features.version') !== version) {
@@ -143,7 +143,7 @@ const filters = {
hookSetting('filters.sort', (value) => {
filters.sort.set(value);
filters.sort.set(options.get('filters.sort'));
@@ -139,7 +139,7 @@ export default {
this.revokers = [];
items.forEach((item) => {
const { name, key, normalize } = item;
settings[name] = normalize(options.get(key || name));