mirror of
https://github.com/wassname/talk.git
synced 2026-08-02 13:10:23 +08:00
No more patched packages!
This commit is contained in:
Generated
+8
-3
@@ -2069,9 +2069,14 @@
|
||||
}
|
||||
},
|
||||
"@types/react-relay": {
|
||||
"version": "github:coralproject/patched#c8e07adee83418ca04acfc99a3c542e082d70116",
|
||||
"from": "github:coralproject/patched#types/react-relay",
|
||||
"dev": true
|
||||
"version": "1.3.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-relay/-/react-relay-1.3.9.tgz",
|
||||
"integrity": "sha512-DFhFrEiDUYxR6VWpkf14CnzS7vtpWaVku0EmnxT2X4U45rOUP75nnOEnRCixZyyxIgr7ULpg5Zc1G9VJpQF7GQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/react": "*",
|
||||
"@types/relay-runtime": "*"
|
||||
}
|
||||
},
|
||||
"@types/react-responsive": {
|
||||
"version": "3.0.1",
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@
|
||||
"@types/query-string": "^6.1.0",
|
||||
"@types/react-copy-to-clipboard": "^4.2.5",
|
||||
"@types/react-dom": "^16.0.6",
|
||||
"@types/react-relay": "github:coralproject/patched#types/react-relay",
|
||||
"@types/react-relay": "^1.3.9",
|
||||
"@types/react-responsive": "^3.0.1",
|
||||
"@types/react-test-renderer": "^16.0.1",
|
||||
"@types/recompose": "^0.26.1",
|
||||
|
||||
@@ -1,22 +1,46 @@
|
||||
import {
|
||||
ConnectionConfig,
|
||||
ConnectionData,
|
||||
createPaginationContainer,
|
||||
FragmentOrRegularProp,
|
||||
GraphQLTaggedNode,
|
||||
RelayPaginationProp,
|
||||
} from "react-relay";
|
||||
import { InferableComponentEnhancerWithProps } from "recompose";
|
||||
import { Variables } from "relay-runtime";
|
||||
import { FragmentKeysNoLocal } from "./types";
|
||||
|
||||
// TODO: (cvle) at some point we might switch these to stock react-relay typings
|
||||
// when they become versatile enough.
|
||||
export type FragmentVariablesGetter<V extends Variables = Variables> = (
|
||||
prevVars: V,
|
||||
totalCount: number
|
||||
) => V;
|
||||
|
||||
export interface ConnectionConfig<
|
||||
P,
|
||||
V extends Variables = Variables,
|
||||
F extends Variables = Variables
|
||||
> {
|
||||
direction?: "backward" | "forward";
|
||||
getConnectionFromProps?(props: P): ConnectionData | undefined | null;
|
||||
getFragmentVariables?: FragmentVariablesGetter<F>;
|
||||
getVariables(
|
||||
props: P,
|
||||
paginationInfo: { count: number; cursor?: string },
|
||||
fragmentVariables: F
|
||||
): V;
|
||||
query: GraphQLTaggedNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* withPaginationContainer is a curried version of `createPaginationContainers`
|
||||
* from Relay.
|
||||
*/
|
||||
export default <T, FragmentVariables, QueryVariables>(
|
||||
export default <T, QueryVariables, FragmentVariables>(
|
||||
fragmentSpec: { [P in FragmentKeysNoLocal<T>]: GraphQLTaggedNode } & {
|
||||
_?: never;
|
||||
},
|
||||
connectionConfig: ConnectionConfig<T, FragmentVariables, QueryVariables>
|
||||
connectionConfig: ConnectionConfig<T, QueryVariables, FragmentVariables>
|
||||
): InferableComponentEnhancerWithProps<
|
||||
{ [P in FragmentKeysNoLocal<T>]: T[P] } & { relay: RelayPaginationProp },
|
||||
{ [P in FragmentKeysNoLocal<T>]: FragmentOrRegularProp<T[P]> }
|
||||
|
||||
@@ -68,8 +68,8 @@ interface FragmentVariables {
|
||||
|
||||
const enhanced = withPaginationContainer<
|
||||
InnerProps,
|
||||
FragmentVariables,
|
||||
ReplyListContainerPaginationQueryVariables
|
||||
ReplyListContainerPaginationQueryVariables,
|
||||
FragmentVariables
|
||||
>(
|
||||
{
|
||||
comment: graphql`
|
||||
|
||||
@@ -65,8 +65,8 @@ interface FragmentVariables {
|
||||
|
||||
const enhanced = withPaginationContainer<
|
||||
InnerProps,
|
||||
FragmentVariables,
|
||||
StreamContainerPaginationQueryVariables
|
||||
StreamContainerPaginationQueryVariables,
|
||||
FragmentVariables
|
||||
>(
|
||||
{
|
||||
asset: graphql`
|
||||
|
||||
Reference in New Issue
Block a user