{"id":28220927,"url":"https://github.com/morulus/promisefactory","last_synced_at":"2025-07-16T18:05:42.231Z","repository":{"id":66348133,"uuid":"62566253","full_name":"morulus/promiseFactory","owner":"morulus","description":"Custom Promise factory","archived":false,"fork":false,"pushed_at":"2016-11-17T12:33:38.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T09:41:16.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/morulus.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,"zenodo":null}},"created_at":"2016-07-04T13:57:29.000Z","updated_at":"2024-02-01T12:55:46.000Z","dependencies_parsed_at":"2023-02-27T00:15:58.956Z","dependency_job_id":null,"html_url":"https://github.com/morulus/promiseFactory","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/morulus/promiseFactory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morulus%2FpromiseFactory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morulus%2FpromiseFactory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morulus%2FpromiseFactory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morulus%2FpromiseFactory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morulus","download_url":"https://codeload.github.com/morulus/promiseFactory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morulus%2FpromiseFactory/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265528991,"owners_count":23782795,"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":"2025-05-18T04:16:30.519Z","updated_at":"2025-07-16T18:05:42.225Z","avatar_url":"https://github.com/morulus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"promiseFactory\n--\nAn factory-function that can create custom Promise with your own configuration\n\n# Getting started\n\n## Install\nES6\n```\nimport promiseFactory from 'promiseFactory';\n```\nES5 compatible (excludes es6 features)\n```js\nvar promiseFactory = require('promiseFactory/es5');\n```\n\n## Configurate\n```js\nvar MyPromise = promiseFactory({\n  immediate: false, \n\tperpetual: false, \n\tautorun: true, \n\texternal: false, \n\tchaining: true,\n});\n```\n\n### Params\n- immediate (default: FALSE) If TRUE `then`|`catch` handler executes right after calling `resolve`, if FALSE `then`|`catch` handler invokes at next tick\n- perpetual (default: FALSE) If TRUE The Promise will never be completed. You can call `resolve` again and again.\n- autorun (default: TRUE) If FALSE function `resolver` will not executed automaticly, you have to call `execute` method manually.\n- external: (default: FALSE) If TRUE allows to call methods `resolve` and `reject` from outside of Promise.\n- chaining: (default: TRUE) If FALSE disables promise chaining, so `then` always returns origin Promise ref.\n\n## Usage\nCreate your own Promise in a bundle of your project to use special abilities\n\n```\nglobal.StreamedPromise = promiseFactory({\n\tperpetual: true,\n\tautorun: false,\n\texternal: true\n});\n\n// Click counter example\nvar clicks = 0;\nvar clickCounter = StreamedPromise;\nclickCounter\n.then(function() { \n ++clicks;\n console.log('You clicks ', clicks, 'times');\n});\n\n$(\"button\").click(StreamedPromise.resolve.bind(StreamedPromise));\n```\n\n# License\nMIT\n\n# Author \nVladimir Kalmykov \u003cvladimirmorulus@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorulus%2Fpromisefactory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorulus%2Fpromisefactory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorulus%2Fpromisefactory/lists"}