This file contains 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 onEndReachedFixData: ModelData[] = [{id: "placeholder"}]; | |
const onEndReachedFixRenderItem = () => null; | |
interface IUseOnEndReachedFix<Data> { | |
data: Data[]; | |
key?: string; | |
onEndReachedThreshold?: number; | |
onEndReached?: () => any; | |
initialLoaded?: boolean; | |
renderItem?: any; |
This file contains 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 React, {useEffect} from "react"; | |
import {StyleProp, StyleSheet, TouchableOpacity, TouchableOpacityProps, ViewProps, ViewStyle} from "react-native"; | |
import Animated, { | |
interpolate, | |
useAnimatedStyle, | |
useSharedValue, | |
withTiming, | |
Easing, | |
Extrapolate, | |
interpolateColor, AnimateProps, |
This file contains 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
# Belongs in the dataset_module. | |
# | |
# Sample usage: | |
# | |
# User.batch_update([[{full_name: "A"}, {full_name: "C"}], [{full_name: "B"}, {full_name: "D"}]]) | |
# User.batch_update([[{id: 4}, {full_name: "C"}], [{id: 5}, {full_name: "D"}]]) | |
# | |
# # Conditions will apply to all the updates. | |
# User.where { created_at < 1.month.ago }.qualify. | |
# batch_update([[{id: 4}, {full_name: "C"}], [{id: 5}, {full_name: "D"}]]) |
This file contains 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 React, {useEffect, useRef} from "react"; | |
import { | |
ColorValue, | |
StyleProp, | |
ViewStyle, View, StyleSheet, TextStyle, Platform, | |
} from "react-native"; | |
import Animated, { | |
useSharedValue, | |
withTiming, | |
useAnimatedProps, |
This file contains 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 React, {useMemo, useRef} from 'react'; | |
import { NativeSyntheticEvent, Text, TextInputSelectionChangeEventData } from 'react-native'; | |
import { | |
defaultTriggerTextStyle, | |
emptyObject, | |
generateValueFromMentionStateAndChangedText, | |
getConfigsArray, | |
getTriggerPartSuggestionKeywords, | |
parseValue, | |
} from "react-native-controlled-mentions/dist/utils"; |
This file contains 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
query IntrospectionQuery { | |
__schema { | |
queryType { name } | |
mutationType { name } | |
subscriptionType { name } | |
types { | |
...FullType | |
} | |
directives { |
This file contains 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 { Reducer } from 'redux'; | |
import { combineForms, FormState, FieldState } from 'react-redux-form'; | |
export interface IFormHelper<Model> { | |
modelPath: string; | |
attributePath: (fieldName: keyof Model) => string; | |
modelAttributePath: (fieldName: keyof Model) => string; | |
dataSelector: (store: any) => Model; | |
fieldMetaDataSelector: (store: any) => (field: keyof Model) => FieldState; | |
formMetaDataSelector: (store: any) => FormState; |
This file contains 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
// These are by no means complete. Please contribute so we can get it to a state where we can put it on DefinitelyTyped | |
declare module 'redux-orm' { | |
/** | |
* Handles the underlying data structure for a {@link Model} class. | |
*/ | |
export class Backend { | |
/** | |
* Handles the underlying data structure for a {@link Model} class. | |
*/ |
This file contains 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
// Aryk: I wanted to be clear here and separate between ReduxOrmModelRevised and Model. ReduxOrmModelRevised is what | |
// I think should be in Redux-ORM library (or packaged as an add-on). Model (below) is application specific. | |
class ReduxOrmModelRevised extends ReduxOrmModel { | |
public static typeCastersByFieldName; | |
public static typeCasters = { | |
string: value => { | |
value = value.toString(); | |
return trim(value) === '' ? null : value; | |
}, | |
integer: value => parseInt(value, 10), |
This file contains 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
module NestedHasManyThrough | |
module Reflection # :nodoc: | |
def self.included(base) | |
base.send :alias_method_chain, :check_validity!, :nested_has_many_through | |
end | |
def check_validity_with_nested_has_many_through! | |
check_validity_without_nested_has_many_through! | |
rescue ActiveRecord::HasManyThroughSourceAssociationMacroError => e | |
# now we permit has many through to a :though source |
NewerOlder