{"id":18060814,"url":"https://github.com/0xleif/flitelaterpoc","last_synced_at":"2025-06-26T11:33:29.497Z","repository":{"id":83170807,"uuid":"300748100","full_name":"0xLeif/FLiteLaterPOC","owner":"0xLeif","description":"FLite and Later POC","archived":false,"fork":false,"pushed_at":"2020-10-02T23:07:58.000Z","size":25098,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T12:29:52.040Z","etag":null,"topics":["flite","later","swift"],"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/0xLeif.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":"2020-10-02T22:18:02.000Z","updated_at":"2020-10-07T19:04:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"49e59fc2-c8fd-4259-b7a9-2f0c9cf9c5d2","html_url":"https://github.com/0xLeif/FLiteLaterPOC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xLeif/FLiteLaterPOC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FFLiteLaterPOC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FFLiteLaterPOC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FFLiteLaterPOC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FFLiteLaterPOC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xLeif","download_url":"https://codeload.github.com/0xLeif/FLiteLaterPOC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FFLiteLaterPOC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262056430,"owners_count":23251676,"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":["flite","later","swift"],"created_at":"2024-10-31T04:10:36.639Z","updated_at":"2025-06-26T11:33:29.469Z","avatar_url":"https://github.com/0xLeif.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [FLite](https://github.com/0xLeif/FLite) and [Later](https://github.com/0xLeif/Later) POC\n\n## FLiteStore\n\n```swift\nclass FLiteStore: ObservableObject {\n    public var memory = FLite(loggerLabel: \"memory-FLITE\")\n    public var persist = FLite(configuration: .file(\"\\(FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first?.path ?? \"\")/default.sqlite\"), loggerLabel: \"persisted-FLITE\")\n}\n```\n\n## FLiteLaterPOCApp\n\n```swift\n@main\nstruct FLiteLaterPOCApp: App {\n    let store = FLiteStore()\n\n    var body: some Scene {\n        WindowGroup {\n            NavigationView {\n                ContentView()\n                    .environmentObject(store)\n            }\n            .onAppear {\n                print(\"Starting to prepare...\")\n                try? store.persist.prepare(migration: Planet.self).wait()\n                print(\"Prepared Migrations\")\n            }\n        }\n    }\n}\n```\n\n## Later Usage\n```swift\n.navigationBarItems(\n    leading: Button(\"Delete All\") {\n        Later.whenAllSucceed(\n            items.map {\n                store.persist.delete(model: $0)\n            }\n        )\n        .flatMap { _ in store.persist.all(model: Planet.self) }\n        .whenSuccess { items = $0 }\n    },\n    trailing: Button(\"100\") {\n        Later.whenAllSucceed(\n            (0 ... 99).map { _ in\n                store.persist.add(model: Planet.random)\n            }\n        )\n        .flatMap { _ in store.persist.all(model: Planet.self) }\n        .whenSuccess { items = $0 }\n    }\n)\n```\n\n![Example Video](.media/example.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xleif%2Fflitelaterpoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xleif%2Fflitelaterpoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xleif%2Fflitelaterpoc/lists"}