# Discrete API(v2.29.0)
If you want to use `useDialog`, `useMessage`, `useNotification`, `useLoadingBar`, `useModal` outside `setup`, you can use `createDiscreteApi` to create corresponding API.
1. Discrete API won't be affected by n-xxx-provider in current app. If you need to share config, you should sync them manually. Also, you'd better not using discrete API and normal API together. 2. Do not call createDiscreteApi in setup since it may cause some unexpected behaviors.
## Demo
```demo
basic.vue
```
## API
### createDiscreteApi
```ts
function createDiscreteApi(
includes: Array<'message' | 'dialog' | 'notification' | 'loadingBar'>,
options: {
configProviderProps: Ref | ConfigProviderProps
messageProviderProps: Ref | MessageProviderProps
dialogProviderProps: Ref | DialogProviderProps
notificationProviderProps:
| Ref
| NotificationProviderProps
modalProviderProps: Ref | ModalProviderProps
loadingBarProviderProps:
| Ref
| LoadingBarProviderProps
}
): {
// only API specified in `includes` will be created
message: MessageApi
dialog: DialogApi
notification: NotificationApi
loadingBar: LoadingBarApi
modal: ModalApi
// Vue app
app: App
unmount: () => void
} {}
```