> For the complete documentation index, see [llms.txt](https://smwb-tech.gitbook.io/vue-flash-message/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smwb-tech.gitbook.io/vue-flash-message/callbacks-object.md).

# Callbacks Object

As second argument you can pass object with two properties: "mounted" and "destroyed".

| Property      | Type         | Description                                |
| ------------- | ------------ | ------------------------------------------ |
| **mounted**   | **Function** | Will be invoked, when flashMessage appears |
| **destroyed** | **Function** | Will be invoked, when flashMessage gone    |

**Example:**

```markup
<p>{{ text }}</p>
<button @click="clickHandler" type="button" name="button">Show Text!</button>
```

For example you can add some sound which will be played when message appears

```javascript
    methods: {
        showText() {
            this.text = 'Hello from callback!'
        },
        clearText() {
            this.text = 'Bye... 1, ..2, ..3';
            let sound = new Audio('audio source'); // add sound source
            sound.play(); // and play it
            setTimeout( () => this.text = '', 3000);
        },
        clickHandler() {
            this.flashMessage.info({
                title: 'Ooooooops!',
                message: 'Do you see this text and hear this sound? Wtf?'
            },
            {
                mounted: showText,
                destroyed: clearText
            })
        }
    }
```
