Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: b59b169a2078b591c7edd0b95cab16ccc4c7da1c
https://github.com/Checkmk/checkmk/commit/b59b169a2078b591c7edd0b95cab16ccc…
Author: Leonardo Petrora <leonardo.petrora(a)checkmk.com>
Date: 2024-10-02 (Wed, 02 Oct 2024)
Changed paths:
A packages/cmk-frontend-vue/src/lib/usePersistentRef.ts
M packages/cmk-frontend-vue/src/lib/utils.ts
Log Message:
-----------
Reactive persistent variable
This composable creates a ref variable that will persist the value on
the browser's local storage. It will read the field from the storage and
in case it is not found, will set the default value
```
import { type Ref } from 'vue'
import usePersistenRef from './composables/usePersistentRef'
import { type WizardMode } from './someFile'
//Use: usePersistenRef ( localStorageVariableName, defaultValue )
const wizardMode: Ref<WizardMode> =
usePersistenRef<WizardMode>('notification_editor_wizard_mode',
'guided')
```
Change-Id: I9434f9885f74af16347a91613de895abf7cca644
To unsubscribe from these emails, change your notification settings at
https://github.com/Checkmk/checkmk/settings/notifications