Download wp-calypso/client/my-sites/patterns/context.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 649 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/patterns/context.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/patterns/context.ts
-
curl -L -o context.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/patterns/context.ts
649 Bytes
| import { createContext, useContext } from 'react'; | |
| import { PatternTypeFilter } from 'calypso/my-sites/patterns/types'; | |
| type PatternsContextProps = { | |
| searchTerm: string; | |
| category: string; | |
| isGridView: boolean; | |
| section: string | null; | |
| patternPermalinkId?: number; | |
| patternTypeFilter: PatternTypeFilter; | |
| referrer?: string; | |
| }; | |
| export const PatternsContext = createContext< PatternsContextProps >( { | |
| searchTerm: '', | |
| category: '', | |
| isGridView: false, | |
| section: null, | |
| patternPermalinkId: undefined, | |
| patternTypeFilter: PatternTypeFilter.REGULAR, | |
| referrer: undefined, | |
| } ); | |
| export const usePatternsContext = () => useContext( PatternsContext ); | |