@nuofe/ndk-runtime-config
v8.2.2
Published
Runtime Config.
Downloads
4
Readme
NDK Runtime Config
Runtime Config.
Install
yarn add @nuofe/ndk-runtime-config
Usage
Get runtime config, may be return empty object.
import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';
const { userInfo } = ndkRuntimeConfig.get<{ userInfo: string }>();
if (userInfo) {
// do something
}
Init runtime config, if userInfo
is undefined, it will be generate via @nuofe/ndk-user.
import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';
const { userInfo } = await ndkRuntimeConfig.init(options);
Set runtime config.
import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';
ndkRuntimeConfig.set({ key: 'value' });