mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
651 B
23 lines
651 B
2 years ago
|
import { reactive } from 'vue'
|
||
|
|
||
|
const storedValue = localStorage.getItem('betaFeatureToggleState')
|
||
|
|
||
|
const initialToggleState = storedValue ? JSON.parse(storedValue) : false
|
||
|
|
||
|
const betaFeatureToggleState = reactive({ show: initialToggleState })
|
||
|
|
||
|
const toggleBetaFeature = () => {
|
||
|
betaFeatureToggleState.show = !betaFeatureToggleState.show
|
||
|
localStorage.setItem('betaFeatureToggleState', JSON.stringify(betaFeatureToggleState.show))
|
||
|
}
|
||
|
|
||
|
const _useBetaFeatureToggle = () => {
|
||
|
return {
|
||
|
betaFeatureToggleState,
|
||
|
toggleBetaFeature,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const useBetaFeatureToggle = createSharedComposable(_useBetaFeatureToggle)
|
||
|
export { useBetaFeatureToggle }
|