{"id":27938542,"url":"https://github.com/willowtreeapps/bark","last_synced_at":"2025-05-07T08:49:10.349Z","repository":{"id":246235373,"uuid":"816403866","full_name":"willowtreeapps/bark","owner":"willowtreeapps","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-03T03:08:35.000Z","size":10,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T04:20:16.608Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/willowtreeapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T17:18:52.000Z","updated_at":"2025-01-03T03:08:04.000Z","dependencies_parsed_at":"2025-01-03T22:01:35.718Z","dependency_job_id":null,"html_url":"https://github.com/willowtreeapps/bark","commit_stats":null,"previous_names":["willowtreeapps/bark"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fbark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fbark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fbark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fbark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willowtreeapps","download_url":"https://codeload.github.com/willowtreeapps/bark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847236,"owners_count":21813438,"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":[],"created_at":"2025-05-07T08:49:09.290Z","updated_at":"2025-05-07T08:49:10.341Z","avatar_url":"https://github.com/willowtreeapps.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bark\nSimple, but powerful, message broadcasting library (similar to NotificationCenter in spirit).\n\nTree bark won't bark. But `bark` will!, and it will help you broadcast information across your app in a structured concurrent way.\n\n## Why Bark\nWith `bark`, you can register subscriptions that require a concurrency context, and be assured at the point of use that the subscription was run when the `await` to the associated post completes. \n\nThis allows you to reason about the order in which tasks associated with subscriptions execute. Making it easier to write testable and understandable code.\n\n## Features\n- **Lightweight and Focused** - Specifically responsible for dealing with message broadcasting.\n- **Swift-native Design** - Bark feels natural and intuitive for Swift developers.\n- **Thread-safe**\n- **Simple** - Very simple syntax\n\n## Installation\nBark is available through the Swift Package Manager. To install it, simply add the following line to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/willowtreeapps/bark.git\", from: \"1.0.2\")\n]\n```\n\n## Usage\nBark allows for structured concurrent message broadcasting. Here's an example from its tests:\n\n### Registration\n\n```swift\n// Bark instance: I recommend registering into dependency injection and resolving it \n// where you need it.\n// Consider [Grove](https://github.com/willowtreeapps/grove) for this purpose!\n//\n// You normally want a single instance of Bark for your app, but you can define \n// different instances that deal with different parts of the app.\n// The instance is similar in purpose to NotificationCenter instance.\n// If not using dependency injection, you can use `Bark.shared`. This is equivalent\n// to NotificationCenter.default.\nlet bark = Bark()\n\nfunc testPostsOfASingleSubscription() async throws {\n    // Given\n    let subscriptions = Bark.Store()\n    var testNotification1PostCount = 0\n\n    func increaseTheCounter() async {\n        testNotification1PostCount += 1\n    }\n\n    bark.subscribe(.testNotification1, in: subscriptions) { _ in\n        await increaseTheCounter()\n    }\n\n    // When\n    await bark.post(.testNotification1)\n    await bark.post(.testNotification1)\n\n    // Then\n    XCTAssertEqual(testNotification1PostCount, 2)\n}\n```\n\n## Contributing\nContributions are immensely appreciated. Feel free to submit pull requests or to create issues to discuss any potential bugs or improvements.\n\n## Author\nBark was created by @rafcabezas at [WillowTree, Inc](https://willowtreeapps.com).\n\n## License\nBark is available under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillowtreeapps%2Fbark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillowtreeapps%2Fbark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillowtreeapps%2Fbark/lists"}