Skip to content

Commit

Permalink
Merge pull request #86 from getditto/we/updateReadME
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
texasRanger09 authored Mar 12, 2024
2 parents bd21a92 + 10b7110 commit 6f7c59c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,16 @@ heartBeatVm.startHeartbeat(config: DittoHeartbeatConfig(id: [String:String], sec
}
```

**Read data only:**

Create a `HeartbeatVM(ditto: <ditto>` object and then call `startHeartbeat(config: DittoHeartbeatConfig, callback: @escaping HeartbeatCallback)`. You can access the data in the callback of `startHeartbeat`
```swift
var heartBeatVm = HeartbeatVM(ditto: DittoManager.shared.ditto!)
heartBeatVm.startHeartbeat(config: DittoHeartbeatConfig(id: [String:String], secondsInterval: Int, collectionName: String, metadata: metadata: [String:Any]? )) { heartbeatInfo in
//use data
}
```

## Ditto Tools Example App
The [Ditto Tools Example App](https://github.com/getditto/DittoSwiftTools/tree/main/DittoToolsApp)
included in this repo allows you to try the DittoSwiftTools package in a standalone app. Open
Expand Down

0 comments on commit 6f7c59c

Please sign in to comment.