This hook lets you use pagination from URQL. I needed a better solution for React Native and infinite lists.
It also has a pullToRefresh
option. Since URQL's pull to refreshes are so insanely flickery, I decided to fake this completely, and make it pretend to spin for one second (plenty for most calls).
Be sure to use useMemo
with your variables!
It comes with typesafety too.
const document = graphql(`
ChatGPT appeared like an explosion on all my social media timelines in early December 2022. While I keep up with machine learning as an industry, I wasn't focused so much on this particular corner, and all the screenshots seemed like they came out of nowhere. What was this model? How did the chat prompting work? What was the context of OpenAI doing this work and collecting my prompts for training data?
I decided to do a quick investigation. Here's all the information I've found so far. I'm aggregating and synthesizing it as I go, so it's currently changing pretty frequently.
Node.js v18 introduces test runner support. This currently experimental feature gives developers the benefits of a structured test harness for their code without having to install a third party test framework, like Mocha or Jest, as a dependency. Using the test runner produces [TAP] output.
The [online reference] provides the most up-to-date, authoritative reference and have plenty of good testing examples. However, there are a few points that might not be immediately obvious from the reference, so those are highlighted here.
import { Model } from 'objection'; | |
export default class TaxRateModel extends Model { | |
countryCode!: string; | |
stripeId!: string; | |
static tableName = 'tax_rate'; | |
} |
#!/bin/sh | |
set -e | |
# 查杀/恢复 CleanMyMac 的流氓后台 HealthMonitor | |
# | |
# - 执行脚本后,原 HealthMonitor.app 会被备份并被空目录替代,然后杀掉后台进程(你直接杀是杀不净的)。此时 CleanMyMac 主应用也不能运行。 | |
# - 再次执行脚本,则将备份的文件恢复回去,CleanMyMac 则可以正常使用。 | |
# | |
# NOTE: 如果不是 Setapp 版本,进程名可能不同,需要自行修改下面变量: |
This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).
Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.
When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.
useSubscription
and useMutableSource
1 tearing and deopt behavior.
The tree below represents a React application mounting. During mount, two components read from an external, mutable source. The first one (List
) reads version 1 of that data and the second one (Item
) reads version 2.
N/A.
import { ApolloClient, QueryOptions, MutationOptions } from 'apollo-client'; | |
import { DocumentNode } from 'graphql'; | |
import { getSdk, Requester } from '.generated/schema-typedefs'; | |
import { ApolloRequestError } from './ApolloRequestError'; | |
export type ApolloRequesterOptions<V, R> = | |
| Omit<QueryOptions<V>, 'variables' | 'query'> | |
| Omit<MutationOptions<R, V>, 'variables' | 'mutation'>; |