···4455const ongoingActions = new Set<any>()
6677+/**
88+ * This is a TypeScript function that optimistically updates data on the client-side before sending a
99+ * request to the server and rolling back changes if the request fails.
1010+ * @param {T} model - The object or record that needs to be updated optimistically.
1111+ * @param preUpdate - `preUpdate` is a function that is called before the server update is executed. It
1212+ * can be used to perform any necessary actions or updates on the model or UI before the server update
1313+ * is initiated.
1414+ * @param serverUpdate - `serverUpdate` is a function that returns a Promise representing the server
1515+ * update operation. This function is called after the previous state of the model has been recorded
1616+ * and the `preUpdate` function has been executed. If the server update is successful, the `postUpdate`
1717+ * function is called with the result
1818+ * @param [postUpdate] - `postUpdate` is an optional callback function that will be called after the
1919+ * server update is successful. It takes in the response from the server update as its parameter. If
2020+ * this parameter is not provided, nothing will happen after the server update.
2121+ * @returns A Promise that resolves to `void`.
2222+ */
723export const updateDataOptimistically = async <
824 T extends Record<string, any>,
925 U,
···11+/**
22+ * This TypeScript function merges multiple React refs into a single ref callback.
33+ * When developing low level UI components, it is common to have to use a local ref
44+ * but also support an external one using React.forwardRef.
55+ * Natively, React does not offer a way to set two refs inside the ref property. This is the goal of this small utility.
66+ * Today a ref can be a function or an object, tomorrow it could be another thing, who knows.
77+ * This utility handles compatibility for you.
88+ * This function is inspired by https://github.com/gregberge/react-merge-refs
99+ * @param refs - An array of React refs, which can be either `React.MutableRefObject<T>` or
1010+ * `React.LegacyRef<T>`. These refs are used to store references to DOM elements or React components.
1111+ * The `mergeRefs` function takes in an array of these refs and returns a callback function that
1212+ * @returns The function `mergeRefs` is being returned. It takes an array of mutable or legacy refs and
1313+ * returns a ref callback function that can be used to merge multiple refs into a single ref.
1414+ */
1515+export function mergeRefs<T = any>(
1616+ refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>,
1717+): React.RefCallback<T> {
1818+ return value => {
1919+ refs.forEach(ref => {
2020+ if (typeof ref === 'function') {
2121+ ref(value)
2222+ } else if (ref != null) {
2323+ ;(ref as React.MutableRefObject<T | null>).current = value
2424+ }
2525+ })
2626+ }
2727+}
···4141 <View testID="contentLanguagesModal" style={[pal.view, styles.container]}>
4242 <Text style={[pal.text, styles.title]}>Content Languages</Text>
4343 <Text style={[pal.text, styles.description]}>
4444- Which languages would you like to see in the What's Hot feed? (Leave
4545- them all unchecked to see any language.)
4444+ Which languages would you like to see in the your feed? (Leave them all
4545+ unchecked to see any language.)
4646 </Text>
4747 <ScrollView style={styles.scrollContainer}>
4848 {languages.map(lang => (
···11import React from 'react'
22import {StyleSheet, View} from 'react-native'
33-import {PostsFeedSliceModel} from 'state/models/feeds/posts'
33+import {PostsFeedSliceModel} from 'state/models/feeds/post'
44import {AtUri} from '@atproto/api'
55import {Link} from '../util/Link'
66import {Text} from '../util/text/Text'