{"id":24509454,"url":"https://github.com/zunjae/vresult","last_synced_at":"2025-03-15T09:24:32.132Z","repository":{"id":202424761,"uuid":"209501519","full_name":"zunjae/VResult","owner":"zunjae","description":"Handle results nicely","archived":false,"fork":false,"pushed_at":"2019-10-23T07:32:19.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T15:16:23.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/zunjae.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}},"created_at":"2019-09-19T08:26:11.000Z","updated_at":"2019-10-23T07:32:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"b583797b-84c6-4636-8f10-8132ed9215cd","html_url":"https://github.com/zunjae/VResult","commit_stats":null,"previous_names":["zunjae/vresult"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FVResult","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FVResult/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FVResult/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FVResult/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zunjae","download_url":"https://codeload.github.com/zunjae/VResult/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243708971,"owners_count":20334935,"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-01-22T00:21:10.229Z","updated_at":"2025-03-15T09:24:32.110Z","avatar_url":"https://github.com/zunjae.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VResult\nHandle results nicely\n\n## Example usage:\n\nViewModel class:\n\n```kotlin\nclass KanonViewModel(val kanonService: KanonService): ViewModel {\n  var bookmarks: MutableLiveData\u003cVResult\u003cList\u003cBookmark\u003e\u003e\u003e = MutableLiveData()\n\n  fun loadBookmarks() {\n    launchListOperation(bookmarks) {\n      kanonService.userBookmarks().execute().body()\n    }\n  }\n}\n```\n\nFragment:\n\n```kotlin\nviewModel.bookmarks.observe(this, Observer { result -\u003e\n      when (result) {\n        is VResult.Loading -\u003e {\n          // show loading\n        }\n        is VResult.Success -\u003e {\n          dataSource.set(result.response)\n        }\n        is VResult.NoResult -\u003e {\n          // show no results\n        }\n        is VResult.Error -\u003e {\n          // show error\n        }\n      }\n    })\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzunjae%2Fvresult","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzunjae%2Fvresult","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzunjae%2Fvresult/lists"}