1 |
|
2 | //const observers = {}
|
3 |
|
4 | // TODO(vjpr): Use event-kit observables.
|
5 | //main.observe = (key, cb) => {
|
6 | // observers[key] = cb
|
7 | //}
|
8 |
|
9 | //_notifyObservers(key, newValue) {
|
10 | // const prevVal = config[key]
|
11 | // const fn = observers[key]
|
12 | // if (fn) fn(newValue, prevVal)
|
13 | //}
|
14 |
|
15 | // TODO(vjpr)
|
16 | //main.setSchema = function(namespace, schema) {
|
17 | // globalSchema.properties = _.merge(globalSchema.properties, {[namespace]: schema})
|
18 | // const ajv = require('ajv')
|
19 | // const validate = ajv.compile(schema)
|
20 | // return _.defaultsDeep(config, validate({}))
|
21 | //}
|