Runtime Config.
npm install @nuofe/ndk-runtime-config[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][downloads-url]
[npm-image]: https://img.shields.io/npm/v/@nuofe/ndk-runtime-config.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@nuofe/ndk-runtime-config
[downloads-image]: https://img.shields.io/npm/dm/@nuofe/ndk-runtime-config.svg?style=flat-square
[downloads-url]: https://www.npmjs.com/package/@nuofe/ndk-runtime-config
Runtime Config.
``bash`
yarn add @nuofe/ndk-runtime-config
Get runtime config, may be return empty object.
`ts
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.
`js
import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';
const { userInfo } = await ndkRuntimeConfig.init(options);
`
Set runtime config.
`js
import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';
ndkRuntimeConfig.set({ key: 'value' });
``