Skip to content

Commit 684feda

Browse files
authored
docs: Clear up confusion around where to register proxy services
1 parent 4c1ed1a commit 684feda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/content/proxy-service/0.installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const [registerMathService, getMathService] = defineProxyService(
2626
```ts [background.ts]
2727
import { registerMathService } from './MathService';
2828

29-
// 2. As soon as possible, register it in the background script
29+
// 2. Register the service at the beginning of the background script
3030
registerMathService();
3131
```
3232

@@ -135,7 +135,7 @@ registerTodosRepo(db);
135135

136136
::
137137

138-
You need to call `register` synchronously at the top level of the background script to avoid race conditions between registering and accessing the service for the first time.
138+
You need to call `register` synchronously at the beginning of the background script to avoid race conditions between registering and accessing the service for the first time.
139139

140140
::alert
141141
Here, even though `openDB` returns a promise, we're not awaiting the promise until executing the functions inside the service.

0 commit comments

Comments
 (0)