blob: e338f5b5e891573f82ea2ac5e274a86b0e8ac736 (
plain) (
tree)
|
|
const ObservableStore = require('obs-store')
const normalizeAddress = require('../sig-util').normalize
class PreferencesController {
constructor (opts = {}) {
const initState = opts.initState || {}
this.store = new ObservableStore(initState)
}
//
// PUBLIC METHODS
//
setSelectedAddress(_address) {
const address = normalizeAddress(_address)
this.store.updateState({ selectedAddress: address })
}
getSelectedAddress(_address) {
return this.store.getState().selectedAddress
}
//
// PRIVATE METHODS
//
}
module.exports = PreferencesController
|