Skip to content

Commit

Permalink
chore: removed copy of doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszjedrasik committed Apr 1, 2021
1 parent 9339978 commit 2600d1e
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions packages/core/docs/guide/composables.md
Expand Up @@ -435,40 +435,3 @@ module.exports = {
```

The custom query function always has in the arguments the default query and default variables and must return the query and its variables as well. In the body you can do anything you want with those parameters - you can override them or even change to the new ones.

## In-app Notifications

In Vue Storefront we're providing Notifications system based on composable `useUiNotification`.

Shows notifications after some actions being performed in the shop. There are three types of notifications: danger, success and info.

There is a dedicated interface for `useUiNotification`:

```ts
interface UseUiNotification {
message: string;
type: 'danger' | 'success' | 'info';
action?: { text: string; onClick: () => void };
icon?: string;
persist?: boolean;
id?: symbol;
dismiss?: () => void;
}
```

### How to send notification?

To send a new notification you need to only import `useUiNotification` from composables and pass `type` and `message` to `send` function. Rest parameters are optional.

```js
import { useUiNotification } from '~/composables';

setup() {
const { send } = useUiNotification();

send({
type: 'success',
message: 'Successfully added product to the cart'
})
}
```

0 comments on commit 2600d1e

Please sign in to comment.