This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect, Dispatch, SetStateAction } from "react"; | |
interface UseStickyReturnType { | |
isSticky: boolean; | |
setIsSticky: Dispatch<SetStateAction<boolean>>; | |
} | |
/** | |
* @description Check sticky with offset | |
* @param offset | |
* @example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 80, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": false, | |
"quoteProps": "as-needed", | |
"jsxSingleQuote": false, | |
"trailingComma": "es5", | |
"bracketSpacing": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GET_DATA_REQUEST = "GET_DATA_REQUEST"; | |
const GET_DATA_SUCCESS = "GET_DATA_SUCCESS"; | |
const GET_DATA_FAILURE = "GET_DATA_FAILURE"; | |
const getDataRequest = (data) => ({ | |
type: GET_DATA_REQUEST, | |
data, | |
}); | |
const getDataSuccess = (data) => ({ | |
type: GET_DATA_SUCCESS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialState = { | |
isLoading: false, | |
data: null, | |
error: null, | |
}; | |
const reducer = (state = initialState, action) => { | |
switch (action.type) { | |
case "GET_DATA_REQUEST": | |
return { |
OlderNewer