Skip to content

Commit

Permalink
Clarify README for doc.ingestSnapshot(snapshot, callback)
Browse files Browse the repository at this point in the history
Addresses documentation issue raised in #254
  • Loading branch information
ericyhwang committed Nov 6, 2018
1 parent abffed5 commit a67ad42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Populate the fields on `doc` with a snapshot of the document from the server, an
fire events on subsequent changes.

`doc.ingestSnapshot(snapshot, callback)`
Ingest snapshot data. This data must include a version, snapshot and type. This method is generally called interally as a result of fetch or subscribe and not directly. However, it may be called directly to pass data that was transferred to the client external to the client's ShareDB connection, such as snapshot data sent along with server rendering of a webpage.
Ingest snapshot data. The `snapshot` param must include the fields `v` (doc version), `data`, and `type` (OT type). This method is generally called interally as a result of fetch or subscribe and not directly from user code. However, it may still be called directly from user code to pass data that was transferred to the client external to the client's ShareDB connection, such as snapshot data sent along with server rendering of a webpage.

This comment has been minimized.

Copy link
@curran

curran Nov 6, 2018

Contributor

It may be good to have something like an example piece of code that constructs the snapshot from a doc.

I'm surprised to see this change directly on master. PR would be a good format for reviewing.

Thanks @ericyhwang for the change!


`doc.destroy()`
Unsubscribe and stop firing events.
Expand Down

0 comments on commit a67ad42

Please sign in to comment.