In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
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 { FlashList, FlashListProps } from "@shopify/flash-list"; | |
import React, { forwardRef, ReactElement } from "react"; | |
type ListProps<T> = Omit<FlashListProps<T>, "children"> & { as?: "list" }; | |
type ScrollViewProps<T> = Omit< | |
FlashListProps<T>, | |
"children" | "data" | "renderItem" | |
> & { | |
as?: "scroll-view"; | |
children: React.ReactNode | React.ReactNode[]; |
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 { createContext, forwardRef, useCallback, useMemo } from "react"; | |
import { FlatList, FlatListProps, ViewToken } from "react-native"; | |
import Animated, { useSharedValue } from "react-native-reanimated"; | |
const MAX_VIEWABLE_ITEMS = 4; | |
type ViewabilityItemsContextType = string[]; | |
export const ViewabilityItemsContext = createContext< | |
Animated.SharedValue<ViewabilityItemsContextType> |
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 { DependencyList, useMemo } from "react"; | |
import { | |
ImageStyle, | |
RegisteredStyle, | |
StyleProp, | |
StyleSheet, | |
TextStyle, | |
ViewStyle, | |
} from "react-native"; |
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 { forEachObjIndexed } from "ramda"; | |
import * as React from "react"; | |
import { | |
Animated, | |
ScrollView, | |
View, | |
ViewStyle, | |
LayoutChangeEvent, | |
NativeScrollEvent, | |
} from "react-native"; |