Skip to content

Commit 2f79ca6

Browse files
authored
Merge pull request #118 from charpeni/various-typos
docs: fix various typos and code errors
2 parents 27d1552 + 1168afb commit 2f79ca6

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

contents/docs/custom-mutators.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Custom mutators introduce a new _server_ component to the Zero architecture.
3535

3636
This server is implemented by you, the developer. It's typically just your existing backend, where you already put auth or other server-side functionality.
3737

38-
The server can be a serverless function, a microservice, or a full stateful server. The only real requirment is that it expose a special _push endpoint_ that `zero-cache` can call to process mutations. This endpoint implements the [push protocol](#custom-push-implementation) and contains your custom logic for each mutation.
38+
The server can be a serverless function, a microservice, or a full stateful server. The only real requirement is that it expose a special _push endpoint_ that `zero-cache` can call to process mutations. This endpoint implements the [push protocol](#custom-push-implementation) and contains your custom logic for each mutation.
3939

4040
Zero provides utilities in `@rocicorp/zero` that make it really easy implement this endpoint in TypeScript. But you can also implement it yourself if you want. As long as your endpoint fulfills the push protocol, `zero-cache` doesn't care. You can even write it in a different programming language.
4141

@@ -163,7 +163,7 @@ export function createMutators() {
163163
issue: {
164164
update: async (tx, {id, title}: {id: string; title: string}) => {
165165
// Validate title length. Legacy issues are exempt.
166-
if (e.length > 100) {
166+
if (title.length > 100) {
167167
throw new Error(`Title is too long`);
168168
}
169169
await tx.mutate.issue.update({id, title});
@@ -268,7 +268,7 @@ Mutations execute instantly on the client, but it is sometimes useful to know wh
268268
You can get the server result of a mutation with the `server` property of a mutator's return value:
269269

270270
```ts
271-
const serverResult = await zero.mutate.issue.update({
271+
const { server } = await zero.mutate.issue.update({
272272
id: 'issue-123',
273273
title: 'New title',
274274
}).server;
@@ -343,22 +343,22 @@ import { schema } from "./schema";
343343
export function createMutators(clientMutators: CustomMutatorDefs<typeof schema>) {
344344
return {
345345
// Reuse all client mutators except the ones in `issue`
346-
...clientMutators
346+
...clientMutators,
347347

348348
issue: {
349349
// Reuse all issue mutators except `update`
350350
...clientMutators.issue,
351351

352352
update: async (tx, {id, title}: { id: string; title: string }) => {
353353
// Call the shared mutator first
354-
await clientMutators.issue.update(tx, args);
354+
await clientMutators.issue.update(tx, {id, title});
355355

356356
// Record a history of this operation happening in an audit
357357
// log table.
358358
await tx.mutate.auditLog.insert({
359359
// Assuming you have an audit log table with fields for
360360
// `issueId`, `action`, and `timestamp`.
361-
issueId: args.id,
361+
issueId: id,
362362
action: 'update-title',
363363
timestamp: new Date().toISOString(),
364364
});

contents/docs/debug/slow-queries.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Here are some tips to help debug such slow queries.
2727

2828
## Check `ttl`
2929

30-
If you are seeing the UI unexpected flicker when moving between views, it is likely that the queries backing these views have the default `ttl` of `never`. Set the `ttl` to some longer value to [keep data cached across navigations](https://zero.rocicorp.dev/docs/reading-data#background-queries).
30+
If you are seeing unexpected UI flicker when moving between views, it is likely that the queries backing these views have the default `ttl` of `never`. Set the `ttl` to some longer value to [keep data cached across navigations](https://zero.rocicorp.dev/docs/reading-data#background-queries).
3131

3232
You may alternately want to [preload some data](https://zero.rocicorp.dev/docs/reading-data#preloading) at app startup.
3333

contents/docs/deployment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To deploy a Zero app, you need to:
88
1. Deploy `zero-cache`. We provide a [Docker image](https://hub.docker.com/r/rocicorp/zero) that can work with most Docker hosts.
99
1. Deploy your frontend. You can use any hosting service like Vercel or Netlify.
1010

11-
This page described how to deploy `zero-cache`.
11+
This page describes how to deploy `zero-cache`.
1212

1313
## Architecture
1414

@@ -54,7 +54,7 @@ When run with multiple View Syncer nodes, `zero-cache` supports rolling, downtim
5454

5555
## Client/Server Version Compatibility
5656

57-
Servers are compatible wth any client of same major version, and with clients one major version back. So for example:
57+
Servers are compatible with any client of same major version, and with clients one major version back. So for example:
5858

5959
- Server `0.2.*` is compatible with client `0.2.*`
6060
- Server `0.2.*` is compatible with client `0.1.*`

contents/docs/permissions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ definePermissions<AuthData, Schema>(schema, () => {
251251

252252
## Delete Permissions
253253

254-
Delete permissions work in the same way as `insert` positions except they run _before_ the delete is applied. So if a delete rule queries the database, it will see that the deleted row is present. If any rule in the ruleset returns a row, the delete is allowed.
254+
Delete permissions work in the same way as `insert` permissions except they run _before_ the delete is applied. So if a delete rule queries the database, it will see that the deleted row is present. If any rule in the ruleset returns a row, the delete is allowed.
255255

256256
## Debugging
257257

contents/docs/reading-data.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ But it's often useful to keep queries syncing beyond deactivation in case the UI
322322
const [user] = useQuery(z.query.user.where('id', userId), {ttl: '1d'});
323323
```
324324

325-
The `ttl` paramater specifies how long the app developer wishes the query to run inthe background. The following formats are allowed (where `%d` is a positive integer):
325+
The `ttl` parameter specifies how long the app developer wishes the query to run in the background. The following formats are allowed (where `%d` is a positive integer):
326326

327327
| Format | Meaning |
328328
| --------- | ------------------------------------------------------------------------------------ |
@@ -395,7 +395,7 @@ Zero returns whatever data it has on the client immediately for a query, then fa
395395

396396
```tsx
397397
const [issues, issuesResult] = useQuery(z.query.issue);
398-
if (issueResult.type === 'complete') {
398+
if (issuesResult.type === 'complete') {
399399
console.log('All data is present');
400400
} else {
401401
console.log('Some data is missing');

contents/docs/writing-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ You can do multiple CRUD mutates in a single _batch_. If any of the mutations fa
129129
```tsx
130130
z.mutateBatch(async tx => {
131131
const samID = nanoid();
132-
tx.user.create({
132+
tx.user.insert({
133133
id: samID,
134134
username: 'sam',
135135
});

contents/docs/zero-schema.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const issueRelationships = relationships(issue, ({many}) => ({
192192
```
193193

194194
<Note>
195-
Currently only two levels of chaining are currently supported for
195+
Currently only two levels of chaining are supported for
196196
`relationships`. See https://bugs.rocicorp.dev/issue/3454.
197197
</Note>
198198

0 commit comments

Comments
 (0)