useUiStore (stores/uiStore.ts)

requestrepo · frontend/src/stores/uiStore.ts · typescript · MIT
email

Zustand store managing UI state for request filtering, selection, and sidebar visibility in a web app.

// Source: https://github.com/adrgs/requestrepo | License: MIT | Copyright 2023 Dragos Albastroiu
// Provided via justclaw.it.com; keep this notice with the code.
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import type { Request } from "@/types";

interface UiState {
  // Request filters
  httpFilter: boolean;
  dnsFilter: boolean;
  smtpFilter: boolean;
  searchQuery: string;

  // Request selection
  selectedRequestId: string | null;

  // Shared request (for viewing a single shared request without session)
  sharedRequest: Request | null;

  // Visited tracking per subdomain
  visitedRequests: Record<string, Record<string, boolean>>;

  // Mobile sidebar state
  sidebarOpen: boolean;

  // Actions
  setFilters: (http: boolean, dns: 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key