# hostinger/3.0.11/vue-frontend/src/composables/useToggle.ts

Hostinger Tools, version 3.0.11. 19 lines.

- Page: https://pluginprobe.com/plugins/hostinger/3.0.11/code/vue-frontend/src/composables/useToggle.ts
- Raw: https://pluginprobe.com/plugins/hostinger/3.0.11/raw/vue-frontend/src/composables/useToggle.ts
- Modified: 2024-06-04T12:01:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/hostinger/3.0.11/code/vue-frontend/src/composables/useToggle.ts#L10-L20`.

```typescript
import { ref } from 'vue';

export const useToggle = (isDefaultToggled = false) => {
  const isToggled = ref(isDefaultToggled);

  const toggle = () => (isToggled.value = !isToggled.value);

  const toggleOn = () => (isToggled.value = true);

  const toggleOff = () => (isToggled.value = false);

  return {
    isToggled,
    toggle,
    toggleOff,
    toggleOn
  };
};

```
