2.0.2 • Published 2 months ago

@tdio/ui-config v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

@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

2.0.2

2 months ago

2.0.0

9 months ago