Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dominatorvbn/crdtswift
https://github.com/dominatorvbn/crdtswift
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dominatorvbn/crdtswift
- Owner: DominatorVbN
- Created: 2024-02-06T20:13:02.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-07T19:22:26.000Z (11 months ago)
- Last Synced: 2024-02-08T17:05:35.012Z (11 months ago)
- Language: Swift
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### ReplicatingTypes
ReplicatingTypes is a Swift package that implements Conflict-Free Replicated Data Types (CRDTs) in Swift. This package is based on the tutorial series on CRDTs at appdecentral.com, which covers various topics such as replicating register, replicating add-only set, replicating dictionary, and more.
**Note: This package is still a work in progress.**
### Installation
To use ReplicatingTypes in your Swift project, add the following line to your `Package.swift` file:
```Swift
dependencies: [
.package(url: "https://github.com/dominatorvbn/CRDTSwift.git", branch: "main")
]
```### Usage
To use ReplicatingTypes in your Swift code, import the module:
```swift
import CRDTSwift
```Then, you can use the various replicating types provided by the package, such as `ReplicatingRegister`, `ReplicatingAddOnlySet`, `ReplicatingDictionary`, and more. For example:
```swift
var register = ReplicatingRegister()
register.write("Hello, world!")
print(register.value)
```### Testing
ReplicatingTypes includes unit tests for each replicating type. To run the tests, open the package in Xcode and select the "CRDTSwift-Package" scheme, then press Command-U.
### Done
#### Implemented
- `LamportTimestamp`,
- `ReplicatingAddOnlySet`,
- `ReplicatingRegister`,
- and `ReplicatingSet`.#### Wrote tests for
- `LamportTimestamp`,
- `ReplicatingAddOnlySet`,
- and `ReplicatingRegister`.### To Do
- Write exhaustive tests for `ReplicatingSet`.
- Continue the journey to the next article, "Replicants All the Way Down."