@sprocketbot/gql-stores
Advanced tools
Comparing version 0.1.0-beta.3 to 0.1.0-beta.4
@@ -1,6 +0,6 @@ | ||
export { BaseStore } from "./BaseStore"; | ||
export { LiveQueryStore } from "./LiveQueryStore"; | ||
export { Mutation } from "./Mutation"; | ||
export { QueryStore } from "./QueryStore"; | ||
export * from "./types"; | ||
export { Client } from "@urql/core"; | ||
export { BaseStore } from "./BaseStore.js"; | ||
export { LiveQueryStore } from "./LiveQueryStore.js"; | ||
export { Mutation } from "./Mutation.js"; | ||
export { QueryStore } from "./QueryStore.js"; | ||
export * from "./types.js"; | ||
export { Client, gql } from "@urql/core"; |
12
index.js
// Reexport your entry components here | ||
export {BaseStore} from "./BaseStore" | ||
export {LiveQueryStore} from "./LiveQueryStore" | ||
export {Mutation} from "./Mutation" | ||
export {QueryStore} from "./QueryStore" | ||
export * from "./types" | ||
export {BaseStore} from "./BaseStore.js" | ||
export {LiveQueryStore} from "./LiveQueryStore.js" | ||
export {Mutation} from "./Mutation.js" | ||
export {QueryStore} from "./QueryStore.js" | ||
export * from "./types.js" | ||
// Reexport client from urql | ||
export {Client} from "@urql/core" | ||
export {Client, gql} from "@urql/core" |
{ | ||
"name": "@sprocketbot/gql-stores", | ||
"version": "0.1.0-beta.3", | ||
"version": "0.1.0-beta.4", | ||
"description": "Wrapper for @urql/core that presents a store-based API instead of a context-based API", | ||
@@ -34,4 +34,5 @@ "devDependencies": { | ||
"./QueryStore": "./QueryStore.js", | ||
".": "./index.js" | ||
".": "./index.js", | ||
"./types": "./types.js" | ||
} | ||
} |
@@ -1,30 +0,20 @@ | ||
import type {CombinedError} from "@urql/core"; | ||
export type BaseVariables = {[prop: string]: string | number | boolean | BaseVariables}; | ||
import type { CombinedError } from "@urql/core"; | ||
export type BaseVariables = { | ||
[prop: string]: string | number | boolean | BaseVariables; | ||
}; | ||
export type QueryStoreValue<Value, Variables> = // State specific types | ||
( | ||
| { | ||
// Error state; data may exist | ||
success: false; | ||
errors: CombinedError; | ||
} | ||
| { | ||
// Success state; data must exist | ||
success: true; | ||
data: Value; | ||
} | ||
| { | ||
// Fetching state | ||
fetching: true; | ||
} | ||
) & { | ||
success?: boolean; | ||
// Leave data & fetching as optional & undefined to help make types more ergonomic | ||
fetching?: boolean; | ||
// If refetching; previous value will continue to be provided. | ||
data?: Value; | ||
// Errors may always exist | ||
errors?: CombinedError; | ||
// Keep variables in the value as well to ensure that they can be displayed | ||
variables: Variables | ||
}; | ||
({ | ||
success: false; | ||
errors: CombinedError; | ||
} | { | ||
success: true; | ||
data: Value; | ||
} | { | ||
fetching: true; | ||
}) & { | ||
success?: boolean; | ||
fetching?: boolean; | ||
data?: Value; | ||
errors?: CombinedError; | ||
variables: Variables; | ||
}; |
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
15
18585
288