{"id":15059684,"url":"https://github.com/athanclark/elm-every","last_synced_at":"2026-01-28T22:36:57.936Z","repository":{"id":57674838,"uuid":"58775863","full_name":"athanclark/elm-every","owner":"athanclark","description":"It's like something that does stuff","archived":false,"fork":false,"pushed_at":"2016-12-25T06:12:40.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T16:22:23.770Z","etag":null,"topics":["elm","poller"],"latest_commit_sha":null,"homepage":null,"language":"Elm","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/athanclark.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}},"created_at":"2016-05-13T22:22:59.000Z","updated_at":"2016-12-25T06:10:23.000Z","dependencies_parsed_at":"2022-09-02T15:01:31.523Z","dependency_job_id":null,"html_url":"https://github.com/athanclark/elm-every","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/athanclark/elm-every","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-every","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-every/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-every/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-every/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athanclark","download_url":"https://codeload.github.com/athanclark/elm-every/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-every/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elm","poller"],"created_at":"2024-09-24T22:46:39.341Z","updated_at":"2026-01-28T22:36:57.904Z","avatar_url":"https://github.com/athanclark.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elm-Every\n\nRepeatidly issue an action, with some time frame in-between.\n\nIt's pretty simple to integrate, all you need is:\n\n- a function to determine how much time to wait until the next issue, based on\n  the total time waited so far: `Time -\u003e Time`\n- an action to issue, with some data it would expect to apply with\n\nThen, to start the poller, you issue `Start` with some data you would want the\naction to use. To update this data, just make another call to `Start`. Then,\nto stop the poller, just issue `Stop`.\n\n\n```elm\nimport Every\n\n\ntype alias EveryState =\n  { kickoffCount : Int\n  }\n\ntype alias MyModel =\n  { mySession : SessionModel\n  , poller    : Every.Model EveryState\n  }\n\ninitMyModel : MyModel\ninitMyModel =\n  { mySession = initSession\n  , poller    = Every.init\n  }\n\ntype MyAction\n  = SessionMsg SessionMsg\n  | EveryMsg (Every.Msg EveryState)\n  | KickStart\n\n-- we're calculating the time to add to the total, based on the current total.\nfibbDelay : Maybe EveryState -\u003e Time -\u003e Time\nfibbDelay _ total = total\n\nissueMsg : Maybe EveryState -\u003e Msg\nissueMsg ms =\n  -- ...\n\n\nupdateModel : MyAction\n           -\u003e MyModel\n           -\u003e (MyModel, Cmd MyAction)\nupdateModel action model =\n  case action of\n    SessionMsg a -\u003e\n      let (newSession, eff) = updateSession a model.mySession\n      in  ( { model | mySession = newSession }\n          , Cmd.map SessionMsg eff\n          )\n    EveryMsg a -\u003e\n      let (newEvery, eff) = updateEvery\n                              fibbDelay\n                              issueMsg\n                              a\n                              model.poller\n      in  ( { model | poller = newEvery }\n          , Cmd.map (\\r -\u003e case r of\n                             Err x -\u003e x -- resolve issued data\n                             Ok  x -\u003e EveryMsg x) eff\n          )\n    KickStart -\u003e\n      ( model\n      , Task.perform (Debug.crash \u003c\u003c toString) EveryMsg\n        \u003c| Every.Start { resetSoFar = True\n                       , modifyData = Just \u003c| Every.Update \u003c| \\ms -\u003e\n                           case ms of\n                             Nothing -\u003e\n                               { kickoffCount = 1\n                               }\n                             Just ks -\u003e\n                               { kickoffCount = ks.kickoffCount + 1\n                               }\n                       }\n      )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Felm-every","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathanclark%2Felm-every","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Felm-every/lists"}