Skip to content

Commit

Permalink
Minor doc typos (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
arv authored Jun 24, 2021
1 parent 320bda4 commit 6c7a287
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion doc/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /faq

Typically, servers send a _poke_ (a content-less hint) over a websocket to tell the client to sync. There are many services you can use for this, and since no content flows over the socket there is no security/privacy concern. See the [integration guide](/guide/poke) for more information.

Replicache also polls at a low interval (60s by default) in case the poke mechanism fails or for applications that don't require low latency udpates. You can adjust this using the [`pullInterval`](api/interfaces/replicacheoptions#pullinterval) field.
Replicache also polls at a low interval (60s by default) in case the poke mechanism fails or for applications that don't require low latency updates. You can adjust this using the [`pullInterval`](api/interfaces/replicacheoptions#pullinterval) field.

## What if I don’t have a dedicated backend? I use serverless functions for my backend

Expand Down
2 changes: 1 addition & 1 deletion doc/docs/guide-design-client-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Now that we know what our schema will look like, let's serve it. Initially, we'l
Create an empty Next.js project:

```bash
npx create-next-app chat --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
npx create-next-app chat --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
cd chat
```

Expand Down
4 changes: 2 additions & 2 deletions doc/docs/guide-dynamic-pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import {db} from '../../db.js';

export default async (req, res) => {
const pull = req.body;
console.log(`Processing pull`, JSON.stringify(pull, null, ''));
console.log(`Processing pull`, JSON.stringify(pull));
const t0 = Date.now();

try {
db.tx(async t => {
await db.tx(async t => {
const lastMutationID = parseInt(
(
await db.oneOrNone(
Expand Down
1 change: 0 additions & 1 deletion doc/docs/guide-local-mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const onSubmit = e => {
content: contentRef.current.value,
order,
});
usernameRef.current.value = '';
contentRef.current.value = '';
};
```
Expand Down
7 changes: 3 additions & 4 deletions doc/docs/guide-remote-mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {db} from '../../db.js';

export default async (req, res) => {
const push = req.body;
console.log('Processing push', JSON.stringify(push, null, ''));
console.log('Processing push', JSON.stringify(push));

const t0 = Date.now();
try {
Expand All @@ -33,10 +33,9 @@ export default async (req, res) => {
}
console.log('version', version, 'lastMutationID:', lastMutationID);

for (let i = 0; i < push.mutations.length; i++) {
for (const mutation of push.mutations) {
const t1 = Date.now();

const mutation = push.mutations[i];
const expectedMutationID = lastMutationID + 1;

if (mutation.id < expectedMutationID) {
Expand All @@ -50,7 +49,7 @@ export default async (req, res) => {
break;
}

console.log('Processing mutation:', JSON.stringify(mutation, null, ''));
console.log('Processing mutation:', JSON.stringify(mutation));

switch (mutation.name) {
case 'createMessage':
Expand Down
4 changes: 2 additions & 2 deletions doc/docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const rep = new Replicache({

// createTodo is asynchronous but subscriptions refire immediately.
// You can treat it as if it's in-memory. You don't need to await.
rep.createTodo(
rep.mutate.createTodo(
id: uuid(),
text: this.state.todoText,
complete: false,
Expand Down Expand Up @@ -241,7 +241,7 @@ await pusher.trigger(`todos-${userID}`, 'poke', {});

After applying a mutation on your server, send a WebSocket "poke" (a message with no payload) hinting to any potentially affected users' devices to try to pull. You can use any WebSocket library or even a hosted service to send this poke. No user data is sent over the web socket — its only purpose is a hint to get the relevant clients to pull soon.

Note that Replicache can also pull on an interval, in addition to or instead of in response to a poke. See [ReplicacheOptions](https://doc.replicache.dev/api/interfaces/replicacheoptions).
Note that Replicache can also pull on an interval, in addition to or instead of in response to a poke. See [ReplicacheOptions](https://doc.replicache.dev/api/interfaces/replicacheoptions) [pullInterval](https://doc.replicache.dev/api/interfaces/replicacheoptions#pullinterval).

## ⑦ Rebase

Expand Down

1 comment on commit 6c7a287

@arv
Copy link
Contributor Author

@arv arv commented on 6c7a287 Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 6c7a287 Previous: 320bda4 Ratio
subscription 10 6.02 ops/sec (±181.7%) 8.34 ops/sec (±111.6%) 1.39

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.