# β¨ useEmbed
useEmbedis 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.