{"id":19063441,"url":"https://github.com/nmuldavin/batch","last_synced_at":"2026-06-23T11:31:42.425Z","repository":{"id":177498747,"uuid":"67953071","full_name":"nmuldavin/batch","owner":"nmuldavin","description":null,"archived":false,"fork":false,"pushed_at":"2016-09-13T02:43:35.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T02:41:21.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/nmuldavin.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-11T20:37:51.000Z","updated_at":"2016-09-11T20:39:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a1c3e46-de02-44fb-b26b-759efc2d0772","html_url":"https://github.com/nmuldavin/batch","commit_stats":null,"previous_names":["nmuldavin/batch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nmuldavin/batch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fbatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fbatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fbatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fbatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmuldavin","download_url":"https://codeload.github.com/nmuldavin/batch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fbatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34686727,"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-06-23T02:00:07.161Z","response_time":65,"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":"2024-11-09T00:35:59.008Z","updated_at":"2026-06-23T11:31:42.405Z","avatar_url":"https://github.com/nmuldavin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#batch.js\n\nbatch.js provides a class for queueing actions to be executed before requesting a new animation frame.\n\n### Normal Use\n\nTo use, intialize a new Batch instance with ``const batch = new Batch()``. Actions can be added to the batch queue via two methods:\n\n* ``batch.queue(fn)``: Immediately adds an action to the queue. Action must be parameterless:\n\n\t```\n\tbatch.queue(() =\u003e {\n\t\tconsole.log(\"I executed\");\n\t});\n\t```\n* ``batch.add(fn)``: Returns a method that adds the specified function to the queue when called. Any arguments passed to this method will be applied to the original function when executed:\n\n\t```\n\tbatch.add((message) =\u003e {\n\t\tconsole.log(message);\n\t})(\"This is my message\");\n\t```\n\nTo execute all queued actions and request a new animation frame, call ``batch.request_frame()``;\n\n### Synchronous Mode\n\nThe batch class may be used in synchronous mode by passing an optional boolean value to the constructor: ``const syncBatch = new Batch(true)`` or by setting ``batch.sync = true``. In synchronous mode, ``request_frame()`` is called immediately when new actions are added to the queue.\n\n### Other methods\n\nTo manually execute all queue actions without requesting a new animation frame, call ``batch.run()``.\n\n### Issues\n\nSee code commenting for potential issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmuldavin%2Fbatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmuldavin%2Fbatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmuldavin%2Fbatch/lists"}