SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > extendify > > src > Shared > state


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/extendify//src/Shared/state

NameTypeSizeLast ModifiedActions
activity.js File 1253 bytes October 08 2024 14:19:28.
ai-consent.js File 1515 bytes May 19 2025 16:47:28.
site-profile.js File 1551 bytes March 13 2025 21:10:44.
unsplash-cache.js File 661 bytes March 13 2025 21:10:44.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/extendify//src/Shared/state/unsplash-cache.js

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

const ONE_WEEK_IN_MILLISECONDS = 1000 * 60 * 60 * 24 * 7;

const state = (set, get) => ({
	images: [],
	expiration: 0,
	isEmpty: () => get().images.length === 0,
	hasExpired: () => Date.now() > get().expiration,
	updateCache: (images) =>
		set({ images, expiration: Date.now() + ONE_WEEK_IN_MILLISECONDS }),
});

export const useUnsplashCacheStore = create(
	persist(devtools(state, { name: 'Extendify Unsplash Images' }), {
		name: `extendify-unsplash-images-${window.extSharedData.siteId}`,
		storage: createJSONStorage(() => localStorage),
	}),
);

SILENT KILLER Tool