@swan-io/graphql-client
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1531,2 +1531,12 @@ 'use strict'; | ||
var useBackwardPagination = createPaginationHook("before"); | ||
var useForwardAsyncDataPagination = (connection) => { | ||
const data = connection.toOption().flatMap((result) => result.toOption()).toNull(); | ||
const patchedData = useForwardPagination(data); | ||
return connection.mapOk(() => patchedData); | ||
}; | ||
var useBackwardAsyncDataPagination = (connection) => { | ||
const data = connection.toOption().flatMap((result) => result.toOption()).toNull(); | ||
const patchedData = useBackwardPagination(data); | ||
return connection.mapOk(() => patchedData); | ||
}; | ||
var usePreviousValue = (value) => { | ||
@@ -1641,4 +1651,6 @@ const previousRef = react.useRef(value); | ||
exports.print = print; | ||
exports.useBackwardAsyncDataPagination = useBackwardAsyncDataPagination; | ||
exports.useBackwardPagination = useBackwardPagination; | ||
exports.useDeferredQuery = useDeferredQuery; | ||
exports.useForwardAsyncDataPagination = useForwardAsyncDataPagination; | ||
exports.useForwardPagination = useForwardPagination; | ||
@@ -1645,0 +1657,0 @@ exports.useMutation = useMutation; |
@@ -0,3 +1,6 @@ | ||
import { AsyncData, Result } from "@swan-io/boxed"; | ||
import { Connection } from "../types"; | ||
export declare const useForwardPagination: <A, T extends Connection<A>>(connection: T) => T; | ||
export declare const useBackwardPagination: <A, T extends Connection<A>>(connection: T) => T; | ||
export declare const useForwardAsyncDataPagination: <A, E, T extends AsyncData<Result<Connection<A>, E>>>(connection: T) => T; | ||
export declare const useBackwardAsyncDataPagination: <A, E, T extends AsyncData<Result<Connection<A>, E>>>(connection: T) => T; |
{ | ||
"name": "@swan-io/graphql-client", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A simple, typesafe GraphQL client for React", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374159
3596