{"id":16487533,"url":"https://github.com/sikanhe/reason-dataloader","last_synced_at":"2025-07-08T06:06:49.367Z","repository":{"id":44140517,"uuid":"188933326","full_name":"sikanhe/reason-dataloader","owner":"sikanhe","description":"Dataloader in Reason using Future as the async primitive","archived":false,"fork":false,"pushed_at":"2023-01-03T22:48:28.000Z","size":754,"stargazers_count":7,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T06:06:39.991Z","etag":null,"topics":["dataloader","graphql","reasonml"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/sikanhe.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":"2019-05-28T01:41:48.000Z","updated_at":"2020-10-22T02:37:18.000Z","dependencies_parsed_at":"2023-02-01T12:00:59.541Z","dependency_job_id":null,"html_url":"https://github.com/sikanhe/reason-dataloader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sikanhe/reason-dataloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Freason-dataloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Freason-dataloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Freason-dataloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Freason-dataloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sikanhe","download_url":"https://codeload.github.com/sikanhe/reason-dataloader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Freason-dataloader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264207110,"owners_count":23572731,"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":["dataloader","graphql","reasonml"],"created_at":"2024-10-11T13:35:10.541Z","updated_at":"2025-07-08T06:06:49.330Z","avatar_url":"https://github.com/sikanhe.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dataloader\n\nThis is an implementation of [Dataloader](https://github.com/graphql/dataloader) in Reason using [Future](https://github.com/RationalJS/future) as the async primitive.\n\n- Original Implemetation: https://github.com/graphql/dataloader\n- Future library used: https://github.com/RationalJS/future\n\nCheckout `src/dataloader.rei` for the full API interface\n\n# Usage\n\n```reason\n\nlet userLoader = Dataloader.make(userIds =\u003e getUsersByIds(userIds));\n\nuserLoader.load(1)\n-\u003eFuture.get(user =\u003e Js.log2(\"found user with ID = 1\", user));\n```\n\n# Caching\n\nCalling the same loader instance with the same keys will result in returning cached futures;\n\n```reason\nuserLoader.load(1) // Future with key = 1\nuserLoader.load(1) // will not issue a dispatch and returns the same Future as previous call\n```\n\nYou can pre-populate the cache with `prime(key, value)`, or clear the cache with `clear(key)` and `clearAll()`.\n\nIt is recommended to create new instances of loaders per user request, so \n1) we don't have a global cache that does not get garbage collected\n2) Having multiple requests writing/reading from the same cache, resulting in unpredictable behaviors. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsikanhe%2Freason-dataloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsikanhe%2Freason-dataloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsikanhe%2Freason-dataloader/lists"}