# extendify/1.17.1/src/HelpCenter/state/globals-sync.js

Extendify, version 1.17.1. 22 lines.

- Page: https://pluginprobe.com/plugins/extendify/1.17.1/code/src/HelpCenter/state/globals-sync.js
- Raw: https://pluginprobe.com/plugins/extendify/1.17.1/raw/src/HelpCenter/state/globals-sync.js
- Modified: 2024-10-08T10:19:28+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/extendify/1.17.1/code/src/HelpCenter/state/globals-sync.js#L10-L20`.

```javascript
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';

const state = (set) => ({
	visibility: 'minimized', // open | minimized | closed
	queuedTour: null,
	queueTourForRedirect: (tour) => set({ queuedTour: tour }),
	clearQueuedTour: () => set({ queuedTour: null }),
	setVisibility: (visibility) => {
		if (!['open', 'minimized', 'closed'].includes(visibility)) {
			throw new Error('Invalid visibility state');
		}
		set({ visibility });
	},
});

export const useGlobalSyncStore = create(
	persist(devtools(state, { name: 'Extendify Help Center Globals Sync' }), {
		name: 'extendify-help-center-globals-sync',
	}),
);

```
