{"id":22820204,"url":"https://github.com/kizzycode/valueprovider-swift","last_synced_at":"2025-03-30T23:16:42.026Z","repository":{"id":66118013,"uuid":"288057249","full_name":"KizzyCode/valueprovider-swift","owner":"KizzyCode","description":"This package defines an API for values managed by a value provider e.g. to interface on-disk values","archived":false,"fork":false,"pushed_at":"2020-11-28T02:00:19.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T04:44:16.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KizzyCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE BSD 2-CLAUSE.md","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":"2020-08-17T01:35:51.000Z","updated_at":"2020-11-28T02:00:21.000Z","dependencies_parsed_at":"2023-02-20T19:45:39.557Z","dependency_job_id":null,"html_url":"https://github.com/KizzyCode/valueprovider-swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fvalueprovider-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fvalueprovider-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fvalueprovider-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fvalueprovider-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KizzyCode","download_url":"https://codeload.github.com/KizzyCode/valueprovider-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390858,"owners_count":20769478,"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":"2024-12-12T15:17:04.361Z","updated_at":"2025-03-30T23:16:42.019Z","avatar_url":"https://github.com/KizzyCode.png","language":"Swift","readme":"# ValueProvider\n\nThis package defines an API for values managed by a value provider; e.g. to interface on-disk values.\n\n\n## Example\n\n```swift\n/// A persistent counter example\nstruct Example {\n    /// Define a test directory (usually you do this once somewhere in your app)\n    static let testDir = FileManager.default.temporaryDirectory\n        .appendingPathComponent(\"de.KizzyCode.FilesystemValueProvider.Tests\")\n    \n    /// Define a provider (usually you do this once somewhere in your app)\n    static let provider = try! FilesystemValueProvider(basePath: Self.testDir)\n    \n    /// The counter value\n    @Mapped(provider: Self.provider, for: \"Example.counter\", default: 0)\n    private var counter: Int\n    \n    /// Does something with the counter value\n    public mutating func count() {\n        defer { self.counter += 1 }\n        print(\"Counter:\", self.counter)\n    }\n}\n\n// Do something with out example\nvar example = Example()\nexample.count()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkizzycode%2Fvalueprovider-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkizzycode%2Fvalueprovider-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkizzycode%2Fvalueprovider-swift/lists"}