mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
19 lines
493 B
TypeScript
19 lines
493 B
TypeScript
import Collection from '#models/collection';
|
|
import { createContext } from 'react';
|
|
|
|
type CollectionsContextType = {
|
|
collections: Collection[];
|
|
setCollections: (collections: Collection[]) => void | Collection[];
|
|
};
|
|
|
|
const iCollectionsContextState: CollectionsContextType = {
|
|
collections: [] as Collection[],
|
|
setCollections: (_: Collection[]) => {},
|
|
};
|
|
|
|
const CollectionsContext = createContext<CollectionsContextType>(
|
|
iCollectionsContextState
|
|
);
|
|
|
|
export default CollectionsContext;
|