{"id":13489443,"url":"https://github.com/dduan/Relay","last_synced_at":"2025-03-28T04:31:11.309Z","repository":{"id":56906373,"uuid":"193283816","full_name":"dduan/Relay","owner":"dduan","description":"Stateless alternatives to Combine.Subject","archived":false,"fork":false,"pushed_at":"2019-08-07T06:35:39.000Z","size":23,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-25T15:08:24.125Z","etag":null,"topics":["combine","reactive-programming","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dduan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-22T22:16:18.000Z","updated_at":"2021-07-26T17:31:27.000Z","dependencies_parsed_at":"2022-08-21T03:20:49.287Z","dependency_job_id":null,"html_url":"https://github.com/dduan/Relay","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dduan%2FRelay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dduan%2FRelay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dduan%2FRelay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dduan%2FRelay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dduan","download_url":"https://codeload.github.com/dduan/Relay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245970535,"owners_count":20702436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["combine","reactive-programming","swiftui"],"created_at":"2024-07-31T19:00:27.787Z","updated_at":"2025-03-28T04:31:10.962Z","avatar_url":"https://github.com/dduan.png","language":"Swift","readme":"# Relay\n\nA `Relay` is a `Combine.Subject` without the interface for sending completion\nsignal.\n\n## Why\n\nA `Subject`, like a `Publisher`, is stateful. Once the complete signal is sent,\nsubscriber will stop receiving values. In practice, this is rarely desirable:\nanyone with a reference to a subject can terminate the data stream for all\nsubscribers, and that becomes a source of bugs.\n\n`Relay`s take away the mutability of the \"completion\" state, making it safer to\nshare.\n\n## Install\n\n### Xcode:\n\nAdd package `https://github.com/dduan/Relay.git`.\n\n### [Swift Package Manager](https://swift.org/package-manager)\n\n```swift\n.package(url: \"http://github.com/dduan/Relay\", from: \"0.1.2\")\n```\n\n### [CocoaPods](http://cocoapods.org/):\n\n```ruby\nuse_frameworks!\n\npod \"CombineRelay\"\n```\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\n```\ngithub \"dduan/Relay\"\n```\n\n## Usage\n\nRelay provides types that thinly wraps around subject types in Combine:\n\n| Relay             | Combine                 |\n|-                  |-                        |\n| Relay             | [Subject][]             |\n| PassthroughRelay  | [PassthroughSubject][]  |\n| CurrentValueRelay | [CurrentValueSubject][] |\n\nEach type has identical interface and behavior to its Combine counterpart. Except it's impossible to send a\ncomplete signal.\n\n[Subject]: https://developer.apple.com/documentation/combine/subject\n[PassthroughSubject]: https://developer.apple.com/documentation/combine/passthroughsubject\n[CurrentValueSubject]: https://developer.apple.com/documentation/combine/currentvaluesubject\n[AnySubject]: https://developer.apple.com/documentation/combine/anysubject\n\n## License\n\nMIT. See `LICENSE.md`\n","funding_links":[],"categories":["Open Source"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdduan%2FRelay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdduan%2FRelay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdduan%2FRelay/lists"}