From 8012ede12698477692b80769781096b559159a32 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 11 Jan 2017 19:04:19 -0800 Subject: background - introduce ObservableStore --- app/scripts/lib/config-manager.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'app/scripts/lib/config-manager.js') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 3a1f12ac0..01e6ccc3c 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -19,6 +19,7 @@ module.exports = ConfigManager function ConfigManager (opts) { // ConfigManager is observable and will emit updates this._subs = [] + this.store = opts.store /* The migrator exported on the config-manager * has two methods the user should be concerned with: @@ -36,12 +37,9 @@ function ConfigManager (opts) { // config data format, and returns the new one. migrations: migrations, - // How to load initial config. - // Includes step on migrating pre-pojo-migrator data. - loadData: opts.loadData, - - // How to persist migrated config. - setData: opts.setData, + // Data persistence methods + loadData: () => this.store.get(), + setData: (value) => this.store.put(value), }) } -- cgit v1.2.3