{"id":15825487,"url":"https://github.com/patrickjs/promises","last_synced_at":"2025-04-01T09:39:51.550Z","repository":{"id":66200354,"uuid":"12305043","full_name":"PatrickJS/promises","owner":"PatrickJS","description":"Promises/A+ implementation base on http://promises-aplus.github.io/promises-spec/","archived":false,"fork":false,"pushed_at":"2013-08-30T13:41:14.000Z","size":192,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T09:21:20.666Z","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/PatrickJS.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":"2013-08-22T18:52:49.000Z","updated_at":"2013-12-14T17:41:31.000Z","dependencies_parsed_at":"2023-02-20T00:15:28.275Z","dependency_job_id":null,"html_url":"https://github.com/PatrickJS/promises","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fpromises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fpromises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fpromises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fpromises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickJS","download_url":"https://codeload.github.com/PatrickJS/promises/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620166,"owners_count":20806716,"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-05T09:20:56.165Z","updated_at":"2025-04-01T09:39:51.521Z","avatar_url":"https://github.com/PatrickJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Promises\n===\n\n[![Promises](http://img.youtube.com/vi/llDikI2hTtk/0.jpg)](http://www.youtube.com/watch?v=llDikI2hTtk)\n\nA promise represents a value that may not be available yet. The primary method for interacting with a promise is its \u003ccode\u003e.then()\u003c/code\u003e method.\n\n\n###Examples\n```javascript\nvar deferred = Promises();\ndeferred.then(function(result) {\n  alert(result);\n});\n\ndeferred.fulfill('Here is my deferred text');\n```\n```javascript\nvar myPromise = (function() {\n  var defer = Promises();\n  \n  var randomInterval = ~~(Math.random()*5000);\n  console.log('randomInterval time set to ' + randomInterval + ' at ' + new Date());\n  \n  setTimeout(function() {\n\n    console.log(new Date());\n    \n    defer.fulfill('resolved my promise');\n    \n  }, randomInterval);\n  \n  return defer;\n}());\n\n\nmyPromise.then(function(text) {\n  alert(text);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Fpromises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickjs%2Fpromises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Fpromises/lists"}