Skip to content

Commit 8a0fce5

Browse files
committed
Improve readme
1 parent 9884f9a commit 8a0fce5

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ With some more complex nested data, it can happend that the Firestore
148148
`updateWithPartial` is available as an alternative.
149149

150150
The original document `ref` is also available, in case you need functionality
151-
that is not covered by this library, or you need to call `update` untyped.
151+
that is not covered by this library.
152152

153153
```ts
154154
export type FsMutableDocument<T> = {
@@ -168,20 +168,19 @@ for more info.
168168
## Client-Side Mutations
169169

170170
In my projects I prefer to have all mutations happen on the server-side via an
171-
API call, so you might want to consider that, especially if older versions of
172-
your app could be around for a while like with mobile apps, because a bug in
173-
client-side code could have lasting effects on the consistency of your data, and
171+
API call. You might want to consider that, especially if older versions of your
172+
app could be around for a while, like with mobile apps. A bug in client-side
173+
code could have lasting effects on the consistency of your database, and
174174
time-consuming to have to work around.
175175

176-
Facilitating client-side writes in a safe way also requires you to write lots of
177-
database rules for your Firestore documents, which can get very complex, so
178-
mutating documents server-side is not only easier to reason about but also more
179-
secure by default.
176+
Facilitating client-side writes in a safe way also requires writing database
177+
rules for your documents, which can get very complex, so mutating documents
178+
server-side is not only easier to reason about but also more secure by default.
180179

181180
## Throwing Errors
182181

183-
The hooks in this library throw errors, which is not a common practice, but this
184-
was a deliberate choice.
182+
The hooks in this library throw errors, instead of returning them, which is not
183+
common practice, but this was a deliberate choice.
185184

186185
In my experience, runtime exceptions for Firestore documents and collection
187186
queries are very rare. By throwing we can avoid having to handle errors, and

0 commit comments

Comments
 (0)