{"name":"flow-stoplight","version":"1.0.0","description":"A simple flow control mechanism.","main":"index.js","scripts":{"test":"node test.js"},"author":"","license":"ISC","devDependencies":{"tape":"^4.4.0"},"gitHead":"b985792e505c0a9d4e7918be4cdb538450b9853f","_id":"flow-stoplight@1.0.0","_shasum":"4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b","_from":".","_npmVersion":"3.5.2","_nodeVersion":"4.2.3","_npmUser":{"name":"kumavis","email":"aaron@kumavis.me"},"dist":{"shasum":"4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b","tarball":"http://registry-npm.ywwl.com/flow-stoplight/download/flow-stoplight-1.0.0.tgz","integrity":"sha512-rDjbZUKpN8OYhB0IE/vY/I8UWO/602IIJEU/76Tv4LvYnwHCk0BCsvz4eRr9n+FQcri7L5cyaXOo0+/Kh4HisA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEABSjOhegy4pmOaASVVSc4B85hM/z5xZkvjxmFD8+Y9AiAoHKlOJ0IV8VgHYn8xk9es/EOisQmyRtlvzrJLFKjZLQ=="}],"size":1668,"noattachment":false,"key":"/flow-stoplight/-/flow-stoplight-1.0.0.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/flow-stoplight-1.0.0.tgz_1454969201565_0.9441104403231293"},"directories":{},"readme":"### Stoplight\n\nA simple flow control mechanism.\n\nHas two modes: \"go\" and \"stop\".\n\nStarts stopped.\n\n```js\nvar stoplight = new Stoplight()\n\nstoplight.await(function(){\n  // this will called when the stoplight is set to \"go\"\n  // if its already \"go\", it will be called on the next frame\n})\n\n// starts stopped\nstoplight.go()\n```\n\n\n### Example\n\nHere is a class that has some async intialization process,\nbut can have its asynchronous method called immediately w/o breaking.\n\n```js\n\nfunction MyClass() {\n  var self = this\n  self._stoplight = new Stoplight()\n  asyncInitialization(function(){\n    self._stoplight.go()\n  })\n}\n\nMyClass.prototype.asyncMethod = function(cb){\n  var self = this\n  self._stoplight.await(function(){\n    // handle the method here and you can be sure that\n    // the async initialization has finished\n  })\n}\n```","publish_time":1454969202561,"_cnpm_publish_time":1454969202561,"dist-tags":{"latest":"1.0.0"}}