mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
17 lines
439 B
TypeScript
17 lines
439 B
TypeScript
import { create } from 'zustand';
|
|
|
|
/** Catalog-only sort state. Used by catalog view sort selector. */
|
|
export type CatalogSortType = 'active' | 'new' | 'replyCount';
|
|
|
|
interface SortingStore {
|
|
sortType: CatalogSortType;
|
|
setSortType: (type: CatalogSortType) => void;
|
|
}
|
|
|
|
const useSortingStore = create<SortingStore>((set) => ({
|
|
sortType: 'active',
|
|
setSortType: (type) => set({ sortType: type }),
|
|
}));
|
|
|
|
export default useSortingStore;
|