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' });