# ✨ useEmbed

useEmbed is a function that allows you to have state variables for embed code blocks in composable components.

# 🍁 Usage

The useEmbed function is used as following reactive state:

import { useEmbed } from 'vue-use-embed';

const { isEmbedBlock, clear } = useEmbed(code);

# πŸš€ Features

useEmbed provides you "reactive" properties that allows you to manage your embed blocks.

  • useEmbed: give as argument a reactive string that contains embed block code.
const code = ref(null);

const { isEmbedBlock, clear } = useEmbed(code);

# βš—οΈ isEmbedBlock

isEmbedBlock is a computed that return the given code is an embed code or not.

# ❌ Clear

Clears scripts added to DOM.

# πŸ’ Example

You can see how it changes reactively using the example below.