The Config class uses object get/set methods
Config 'Config'
IConfig 'IConfig'
let defaultConfig = { name: 'something' }
let config:IConfig = new Config(defaultConfig)
let name = config.get('name')
config.set('app.version', '1.1.0')
let version = config.get('app.version')
let app = config.get('app') // returns object with app children
version = app.version; // also works
using the static makeProperty method, this class can be embedded into a helper function
let _config:IConfig = new Config(defaultConfig)
let config:IConfigProperty = Config.makeProperty(_config)
let version = config('app.version')
// All public methods fron Config are still available
config.get()
config.set()
//etc
The Config class uses object get/set methods
Config'Config'IConfig'IConfig'let defaultConfig = { name: 'something' } let config:IConfig = new Config(defaultConfig) let name = config.get('name') config.set('app.version', '1.1.0') let version = config.get('app.version') let app = config.get('app') // returns object with app children version = app.version; // also worksusing the static
makePropertymethod, this class can be embedded into a helper functionlet _config:IConfig = new Config(defaultConfig) let config:IConfigProperty = Config.makeProperty(_config) let version = config('app.version') // All public methods fron Config are still available config.get() config.set() //etcIConfigProperty
IConfig
Config'Config'{PersistentConfig}