{"id":16665678,"url":"https://github.com/zmmbreeze/onetask","last_synced_at":"2025-06-13T09:34:11.253Z","repository":{"id":138317646,"uuid":"5424809","full_name":"zmmbreeze/OneTask","owner":"zmmbreeze","description":"Only one running task for each browser","archived":false,"fork":false,"pushed_at":"2012-08-31T14:15:04.000Z","size":141,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T19:15:01.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zmmbreeze.github.com/OneTask/","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/zmmbreeze.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":"2012-08-15T10:30:53.000Z","updated_at":"2020-03-13T17:18:32.000Z","dependencies_parsed_at":"2023-03-14T05:15:52.649Z","dependency_job_id":null,"html_url":"https://github.com/zmmbreeze/OneTask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zmmbreeze/OneTask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FOneTask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FOneTask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FOneTask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FOneTask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmmbreeze","download_url":"https://codeload.github.com/zmmbreeze/OneTask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FOneTask/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259619334,"owners_count":22885489,"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":"2024-10-12T11:07:54.373Z","updated_at":"2025-06-13T09:34:11.171Z","avatar_url":"https://github.com/zmmbreeze.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"One task for each browser\n===========================\n\nOneTask is a simple javascript library to make sure a timing task only execute in one page for each browser.\n\nExample\n---------------\n\nCheck out the index.html\n\nAPI\n--------------\n\n    var t =  new OneTask(\n                'Name',\n                function(syncReturn, n1, n2, n3) {\n                    // only server page run this function(Task)\n                    n1 === 1;\n                    n2 === 2;\n                    n3 === 3;\n                    // syncReturn: return the result of task\n                    // result will be serialize to json string\n                    syncReturn({\n                      'm':'11'\n                    });\n                },\n                {\n                    interval: 30000,        // interval of task\n                    serverTimeout: 1000,    // timeout of server\n                    params: [1,2,3]         // task params\n                }\n            );\n    // cancel the task, and can't start again\n    t.cancel();\n    // start the task\n    t.start();\n    // temporarily stop the task\n    t.stop();\n    // regist callback，which runs after the task\n    // parameter of callback is the result of task\n    t.onCallBack(function(data) {\n      this === t;\n      data.m === 11;\n    });\n    // regist callback，which runs when the result change\n    // parameter of callback is the result of task\n    t.onChangeCallBack(function(data) {\n      this === t;\n      data.m === 11;\n    });\n\n    NOTE: if the result of task is null, it means task is not ready. It's not a right result, don't use it;\n\n\n#Licentse\nMIT. Be pleasure to fork and modify it.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmmbreeze%2Fonetask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmmbreeze%2Fonetask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmmbreeze%2Fonetask/lists"}