@tdio/ui-config
v2.0.0
Published
TDIO application common config wrapper (with ENV inject supports)
Downloads
5
Readme
@tdio/ui-config
TDIO application common config wrapper (with ENV inject supports)
Installation
yarn add @tdio/ui-config -D
Usage
import { createConfigWorker } from '@tdio/ui-config'
import { getQuery } from '@/utils'
import settings from './settings'
const cfgWorker = createConfigWorker({
env: process.env,
initial: settings,
spec: {
uiEmbed: {
initial: false,
getter () {
return getQuery<string>('uiEmbed')
}
}
}
})
export const getEnv = cfgWorker.getEnv
export default function getConfig <T> (ns?: string, defval?: T): T {
return cfgWorker.getConfig(ns, defval)
}
License
MIT Copyright (c) tdio