{"id":24509445,"url":"https://github.com/zunjae/kount","last_synced_at":"2026-07-08T21:31:31.064Z","repository":{"id":202424753,"uuid":"194111528","full_name":"zunjae/Kount","owner":"zunjae","description":"Count and react","archived":false,"fork":false,"pushed_at":"2019-09-17T07:32:25.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-14T17:01:53.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":false,"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/zunjae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-06-27T14:34:49.000Z","updated_at":"2019-09-17T07:32:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"be930051-49d4-4534-8891-65ffa0af1bef","html_url":"https://github.com/zunjae/Kount","commit_stats":null,"previous_names":["zunjae/kount"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zunjae/Kount","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FKount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FKount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FKount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FKount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zunjae","download_url":"https://codeload.github.com/zunjae/Kount/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunjae%2FKount/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35279442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:09.346Z","updated_at":"2026-07-08T21:31:31.046Z","avatar_url":"https://github.com/zunjae.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kount\n\nPerform actions based on a counter\n\n## Why\n\nI created this library because I didn't really like [Once](https://github.com/jonfinerty/Once)\n\n## Setup\n\n* Include Kount.kt in your project.\n\n\n## Usage\n\n* Create an instance of Kount\n* If you use Koin, then register as follows:\n\n```Kotlin\nval koinModule: Module = module {\n    single { Kount(WhateverSharedPreference()) as Kountable }\n}\n```\n\nand lazily inject like:\n\n```Kotlin\nval counters: Kountable by inject()\n```\n\nNow check what available method you need. Here is a sample usage:\n\n```Kotlin\nval key = \"PageVisits\"\nval currentCounter = counters.count(key) // returns null because this key doesn't exist\n\ncounters.matches(key, Komparison.Exactly(5)) // returns false AND sets the value of `key` to 1\ncounters.matches(key, Komparison.LessThan(5)) // returns true AND sets the value of `key` to 2\ncounters.matches(key, Komparison.Repeat(2, 2) // returns true AND sets the value of `key` to 3\n```\n\nThe `Repeat` option is my favorite one. You can repeat a task for Y amount of times every X time you call `matches` on it!\nLook at the code to see how it works.\n\n\n## Contributing\n\nPull requests are not welcome\n\n## TODO: \n\n* Add a value change listener\n\n## License\n\nThis project is available under the MIT license, though there is no need to include a license and copyright notice\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzunjae%2Fkount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzunjae%2Fkount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzunjae%2Fkount/lists"}