Skip to content

Instantly share code, notes, and snippets.

View byteab's full-sized avatar
🏠
Working from home

Ehsan sarshar byteab

🏠
Working from home
View GitHub Profile
@byteab
byteab / withBounce.tsx
Last active August 14, 2025 10:16
Achieve apple like spring motions with react native reanimated 3
import { withSpring } from 'react-native-reanimated'
export interface AppleSpringConfig {
duration?: number
bounciness?: number
velocity?: number
overshootClamping?: boolean
restSpeedThreshold?: number
restDisplacementThreshold?: number
}
@byteab
byteab / ReactNativeResponsiveUtilities.ts
Last active September 1, 2022 11:36
React Native Responsive Utility Functions
import { Dimensions } from 'react-native';
const { height: screenHeight, width: screenWidth } = Dimensions.get('window');
const EACH_HEIGHT_UNIT = screenHeight / 100
const EACH_WIDTH_UNIT = screenWidth / 100
/**
* device height percentage
*/
@byteab
byteab / middleware.ts
Last active June 3, 2021 16:31
persist middleware catch implemented correctly
import {
GetState,
PartialState,
SetState,
State,
StateCreator,
StoreApi,
} from './vanilla'
export const redux = <S extends State, A extends { type: unknown }>(