{"_id":"biff","_rev":"102-37d8e8e5c4440bc88ed4b31b4859327b","name":"biff","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"biff","version":"0.0.1","keywords":["flux","react","mcfly"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.0.1","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}],"homepage":"https://github.com/kenwheeler/mcfly","bugs":{"url":"https://github.com/kenwheeler/mcfly/issues"},"dist":{"shasum":"2d30fc4fb2f37cbdc86c3588a47a0178a7ab1265","tarball":"https://registry.npmjs.org/biff/-/biff-0.0.1.tgz","integrity":"sha512-f70KLz45HHYnxXM4cXiIg8BVZDwKheCJdKkFUsmeQCyhAtk9eW6dgnMzTrfuf7y7tgqUAReWEIhjq1JbqcxqjA==","signatures":[{"sig":"MEQCIH6WhekH59nk+YX5WcANXPTYcJI2NhZXxmBDqap5pWfVAiAcb3B4DrhjAX7w/KPS9AvtMZOhaDn7AtLV6iOV+mmsnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"2d30fc4fb2f37cbdc86c3588a47a0178a7ab1265","gitHead":"9dfe3026f31bef8f9dbcb2f92a9ba03837f0c843","scripts":{"test":"jest"},"_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"repository":{"url":"https://github.com/kenwheeler/mcfly","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","invariant":"^1.0.2","es6-promise":"^2.0.0","object-assign":"^1.0.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","jest-cli":"^0.1.18","browserify":"^5.9.1","gulp-react":"^0.5.0","react-tools":"^0.12.0","gulp-replace":"^0.4.0","vinyl-source-stream":"^0.1.1"}},"0.1.0":{"name":"biff","version":"0.1.0","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.1.0","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"05d8105979c112ddabf78483cc1b668419881330","tarball":"https://registry.npmjs.org/biff/-/biff-0.1.0.tgz","integrity":"sha512-wgC6ZuYDB3LXhscTuKe6O6hzz2AULxzHDaoIvT9ZZHrSiyeJ3rgaak1ArpojZI2QIc6p/lnLcgLV6Y8Q6cp5tA==","signatures":[{"sig":"MEUCIFxAt7Aft5eZ8GJbe2Kw5xMvCbxdCCt4y8IEfhQK5JeXAiEA776yqc80EakonCmY2oDabDWDCdf12RzjVq6WRW/FInU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"05d8105979c112ddabf78483cc1b668419881330","gitHead":"43959389855432aa1f77ebf6f82c13d4c96d7b08","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"https://github.com/formidablelabs/biff","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","es6-promise":"^2.0.0","object-assign":"^1.0.0","simple-console":"^0.1.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"0.1.1":{"name":"biff","version":"0.1.1","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.1.1","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"16e9b0d6b4960a9105e1dbf3cb6c655a1fb444d9","tarball":"https://registry.npmjs.org/biff/-/biff-0.1.1.tgz","integrity":"sha512-22g+aeP885OYmOZLbSKOnhX+UMc9IcNjRmadp+3PBh3hQksxLrjPWck5X8m5tk5b5JVmF4CxsgCn7WoblVMGTA==","signatures":[{"sig":"MEUCIQC3oni0ufxBRQanJxN/HbVr98hPWssPLP54rRK0q8yt8QIgeHBQ0HrxPBSWGRioTCsMt3arxN8WZlLGd4Nivbn9MeY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"16e9b0d6b4960a9105e1dbf3cb6c655a1fb444d9","gitHead":"db8925c189f215dd528ca946c6682b8755da06e7","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"https://github.com/formidablelabs/biff","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","es6-promise":"^2.0.0","object-assign":"^1.0.0","simple-console":"^0.1.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"0.1.2":{"name":"biff","version":"0.1.2","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.1.2","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"c00cfcff688e316851ead0c3e6feba93fe38e917","tarball":"https://registry.npmjs.org/biff/-/biff-0.1.2.tgz","integrity":"sha512-qrhcp1iXpgzz8ANE3M1S5u9pCT/6A6qjgs4ik5XCZr/hzOnBe/YWFUb2iAPULHm1yy8Bh51772X4S3ymBHaB/g==","signatures":[{"sig":"MEUCIE0Jc01qD7PsGkL+31VYO8BPWs90ml9H/K1wm/bsFp/3AiEAvx3YX+pBc+Z7glOAYQZBEadpQwGv2mg9kAbXlspNXVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"c00cfcff688e316851ead0c3e6feba93fe38e917","gitHead":"11037c34f44c7950911bf7c27f1ab6a3c087713b","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"https://github.com/formidablelabs/biff","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","es6-promise":"^2.0.0","object-assign":"^1.0.0","simple-console":"^0.1.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"0.1.3":{"name":"biff","version":"0.1.3","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.1.3","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"a75b37c20fc0decec104270e053c2d8d0d49e24b","tarball":"https://registry.npmjs.org/biff/-/biff-0.1.3.tgz","integrity":"sha512-ed5nJhwApKFNlVThHwIGx6Lsj+x9jDQGuMZVH8L/wlurIUG2XbKS7t8U3lqO7V+8unRpf3XFXGAT9TSG2mKr7w==","signatures":[{"sig":"MEUCIQCHNB5RaBc8LTSIUI9sbuNoczLe5omyCBj1JvoFxBiPswIgRXam/MLeElsP8OlSoohMnAHhYdEMNrfbSzdbVrzUlEA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"a75b37c20fc0decec104270e053c2d8d0d49e24b","gitHead":"37bd0e3e9d8698ad31312ad8368aeeba16534e88","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"https://github.com/formidablelabs/biff","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","es6-promise":"^2.0.0","object-assign":"^1.0.0","simple-console":"^0.1.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"0.1.4":{"name":"biff","version":"0.1.4","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.1.4","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"4f237fdc1d219ab30519cdf5209588381f3802e1","tarball":"https://registry.npmjs.org/biff/-/biff-0.1.4.tgz","integrity":"sha512-/t/j1Vt2PgKbwwthyfnqY2dADgRNE/KhGvXy3mKKQXvYF2S7sUVTzx+bBu+n/PwhykBwHKDZp/swFJk3mxJN+w==","signatures":[{"sig":"MEYCIQD1hoUud3LlMJElchEsKz2pO351OSis9WraAk+K/rgCXAIhAMOsZUVHDrnVH8rdAUNVuowbqsRomxSTody4fWNh0Q1B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"4f237fdc1d219ab30519cdf5209588381f3802e1","gitHead":"575b64585b7aae95e64024eae2b2ba28fecf6986","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"https://github.com/formidablelabs/biff","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","es6-promise":"^2.0.0","object-assign":"^1.0.0","simple-console":"^0.1.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","react":"^0.13.1","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"0.1.6":{"name":"biff","version":"0.1.6","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.1.6","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"fd516f2ea5347ea73aeba7f97cbbc41027100733","tarball":"https://registry.npmjs.org/biff/-/biff-0.1.6.tgz","integrity":"sha512-wQaaPmW6LIasO2ZpCEdK44g5BC9MVqAq6vXRGwCoSAg/KBB20vaLNCo+IYgswqCLKOWlhfd6AdZZTmWI+WQrQQ==","signatures":[{"sig":"MEYCIQDAmfPi59FYa9dfJXGlbTd+WFrRYT0k+UOMS3fVyV9JJwIhAKx9HszQsXPyXFl0x2511w6QvGQybsUnYa9y1+fKDSMM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"fd516f2ea5347ea73aeba7f97cbbc41027100733","gitHead":"fc36cfe89be88671e10e125e55921286ee0708f3","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"https://github.com/formidablelabs/biff","type":"git"},"_npmVersion":"1.4.28","description":"Flux architecture made easy","directories":{},"dependencies":{"flux":"^2.0.1","events":"^1.0.2","es6-promise":"^2.0.0","object-assign":"^1.0.0","simple-console":"^0.1.1"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","react":"^0.13.1","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"0.2.0":{"name":"biff","version":"0.2.0","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@0.2.0","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"}],"homepage":"https://github.com/formidablelabs/biff#readme","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"0253202de237e412d0f6e829a6572fad5abf6006","tarball":"https://registry.npmjs.org/biff/-/biff-0.2.0.tgz","integrity":"sha512-0yHOl96Kq+eMquo74yCeNcQI2Aa4nnO3hoPTn0g09dXCIsmk/jklCY5NWVhbHdo5A+a6Q2OC9D3Duq86kUrOSg==","signatures":[{"sig":"MEUCIQDhDbU7s8ZHdFjkQfW0Vkqk7R4TVGe8gT5EgdAJcXyICAIgZEjQKMPzFhcEDFLzUFWcs+dkZ6mUN2XF9Bm46Vnm0TE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../jest-preprocessor.js"},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"0253202de237e412d0f6e829a6572fad5abf6006","gitHead":"309c38a77dc42b19fc38bcd13d96c448cbf45076","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"git+https://github.com/formidablelabs/biff.git","type":"git"},"_npmVersion":"2.8.4","description":"Flux architecture made easy","directories":{},"_nodeVersion":"0.12.2","dependencies":{"flux":"^2.0.1","events":"^1.0.2","es6-promise":"^2.0.0","object-assign":"^1.0.0"},"devDependencies":{"del":"^0.1.2","gulp":"^3.8.6","react":"^0.13.1","envify":"^3.2.0","jest-cli":"^0.4.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}},"1.0.0":{"name":"biff","version":"1.0.0","keywords":["flux","react","biff"],"author":{"name":"Ken Wheeler"},"license":"BSD","_id":"biff@1.0.0","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"},{"name":"thekenwheeler","email":"ken@outlook.com"},{"name":"formidablelabs","email":"holler@formidablelabs.com"}],"homepage":"https://github.com/formidablelabs/biff#readme","bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"dist":{"shasum":"c9ac758a925ee6a0ecaf63e882d7bf13321ea527","tarball":"https://registry.npmjs.org/biff/-/biff-1.0.0.tgz","integrity":"sha512-GGbVRf+53XEjSdFEHh8rt+f1I1rCuwf2gueUey9MW64t/me1x1qGeEJP2PFKCugW+VJKN2+rc32bl5Tyq+h4bg==","signatures":[{"sig":"MEYCIQC3Iz7T0yvCKNM3coSXmklBZ2EpvYFSnEV73vs6BM7RwQIhALsT0tqMr8+howwC0Erfq4HVMffUI0dUA6pLfKGGfKNk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"rootDir":"src","scriptPreprocessor":"../node_modules/babel-jest","testFileExtensions":["es6","js"],"moduleFileExtensions":["js","json","es6"]},"main":"index.js","_from":".","files":["index.js","lib/","LICENSE"],"_shasum":"c9ac758a925ee6a0ecaf63e882d7bf13321ea527","gitHead":"acd08166549b43de4f82398c8bde58edd5bddb36","scripts":{"test":"jest"},"_npmUser":{"name":"thekenwheeler","email":"ken@outlook.com"},"repository":{"url":"git+https://github.com/formidablelabs/biff.git","type":"git"},"_npmVersion":"2.9.0","description":"Flux architecture made easy","directories":{},"_nodeVersion":"2.0.0","dependencies":{"fbjs":"^0.3.2","flux":"^2.0.1","events":"^1.0.2","es6-promise":"^2.0.0","object-assign":"^1.0.0","react-pure-render":"^1.0.2"},"devDependencies":{"del":"^0.1.2","fbjs":"^0.3.2","gulp":"^3.8.6","babel":"^5.8.23","react":"^0.14.0","envify":"^3.2.0","jest-cli":"^0.5.10","react-dom":"^0.14.0","babel-core":"^5.8.25","babel-jest":"^5.3.0","browserify":"^5.9.1","gulp-babel":"^4.0.0","gulp-replace":"^0.4.0","gulp-jscs-custom":"^0.1.2","vinyl-source-stream":"^0.1.1"}}},"time":{"created":"2015-02-24T22:56:33.250Z","modified":"2026-07-20T21:08:58.783Z","0.0.1":"2015-02-24T22:56:33.250Z","0.1.0":"2015-03-04T16:35:01.721Z","0.1.1":"2015-03-06T21:12:15.855Z","0.1.2":"2015-03-06T22:38:06.619Z","0.1.3":"2015-03-07T13:26:59.278Z","0.1.4":"2015-03-22T20:40:15.417Z","0.1.6":"2015-04-03T12:56:58.556Z","0.2.0":"2015-06-23T19:47:26.835Z","1.0.0":"2015-10-19T18:58:22.779Z"},"bugs":{"url":"https://github.com/formidablelabs/biff/issues"},"author":{"name":"Ken Wheeler"},"license":"BSD","homepage":"https://github.com/formidablelabs/biff#readme","keywords":["flux","react","biff"],"repository":{"url":"git+https://github.com/formidablelabs/biff.git","type":"git"},"description":"Flux architecture made easy","maintainers":[{"email":"sarahmichelleegan@gmail.com","name":"sarmeyer"},{"email":"mariano.martinez@formidable.com","name":"mariano-formidable"},{"email":"ryan@loose-bits.com","name":"ryan.roemer"},{"email":"admin@formidablelabs.com","name":"formidable-owner"},{"email":"npm@formidablelabs.com","name":"formidablelabs"},{"email":"sarah.wright@formidable.com","name":"sarahformidable"},{"email":"senesealessandro@gmail.com","name":"ceceppa"},{"email":"ryan@eastridge.me","name":"eastridge"},{"email":"ken_wheeler@me.com","name":"thekenwheeler"}],"readme":"#Biff\nFlux Architecture Made Easy\n\n*What is Biff?*\n\nWhen writing ReactJS apps, it is enormously helpful to use Facebook's Flux architecture. It truly complements ReactJS' unidirectional data flow model. Facebook's Flux library provides a Dispatcher, and some examples of how to write Actions and Stores. However, there are no helpers for Action & Store creation, and Stores require 3rd part eventing.\n\nBiff is a library that provides all 3 components of Flux architecture, using Facebook's Dispatcher, and providing factories for Actions & Stores.\n\n###Demo\n\nCheck out this JSFiddle Demo to see how Biff can work for you:\n\n[http://jsfiddle.net/2xtqx3u3/](http://jsfiddle.net/2xtqx3u3/)\n\n###Getting Started\n\nThe first step to using Biff is to create a new instance of Biff.\n\n####Standalone\n\n```javascript\nvar biff = new Biff();\n```\n\n####Modular\n```javascript\nvar Biff = require('biff');\nmodule.exports = new Biff();\n```\n\nEach instance of Biff has its own Dispatcher instance created and attached.\n\nIn fact, all created Actions & Stores are also stored on the Biff object as `actions` and `stores` respectively.\n\n```javascript\nbiff.dispatcher // Dispatcher instance\nbiff.actions // Array of actions\nbiff.stores // Array of stores\n```\n\n###Stores\n\nBiff has a **createStore** helper method that creates an instance of a Store. Store instances have been merged with EventEmitter and come with **emitChange**, **addChangeListener** and **removeChangeListener** methods built in.\n\nWhen a store is created, its methods parameter specified what public methods should be added to the Store object. Every store is automatically registered with the Dispatcher and the `dispatcherID` is stored on the Store object itself, for use in `waitFor` methods.\n\nCreating a store with Biff looks like this:\n\n```javascript\n// Require the Biff instance you created\nvar biff = require('./biff');\n\n// Internal data object\nvar _todos = [];\n\nfunction addTodo(text) {\n  _todos.push(text);\n}\n\nvar TodoStore = biff.createStore({\n\ngetTodos: function() {\n  return _todos;\n}\n\n}, function(payload){\n\n  switch(payload.actionType) {\n  case 'ADD_TODO':\n    addTodo(payload.text);\n    this.emitChange();\n  break;\n  default:\n    return true;\n  }\n\n  return true;\n\n});\n```\n\nUse `Dispatcher.waitFor` if you need to ensure handlers from other stores run first.\n\n```javascript\nvar biff = require('./biff');\nvar Dispatcher = Biff.dispatcher;\nvar OtherStore = require('../stores/OtherStore');\n\nvar _todos = [];\n\nfunction addTodo(text, someValue) {\n  _todos.push({ text: text, someValue: someValue });\n}\n\n ...\n\n    case 'ADD_TODO':\n      Dispatcher.waitFor([OtherStore.dispatcherID]);\n      var someValue = OtherStore.getSomeValue();\n      addTodo(payload.text, someValue);\n      break;\n\n ...\n```\n\nStores are also created a with a ReactJS component mixin that adds and removes store listeners that call an **storeDidChange** component method.\n\nAdding Store eventing to your component is as easy as:\n\n```javascript\nvar TodoStore = require('../stores/TodoStore');\n\nvar TodoApp = React.createClass({\n\n  mixins: [TodoStore.mixin],\n  storeDidChange: function () {\n    // Handle store change here\n  }\n\n  ...\n```\nThis mixin also adds listeners that call a **storeError** component method, so that if you call `this.emitError('Error Messaging')` in your store, you can respond and handle this in your components:\n\n```javascript\nvar TodoStore = require('../stores/TodoStore');\n\nvar TodoApp = React.createClass({\n\n  mixins: [TodoStore.mixin],\n  storeError: function (error) {\n    console.log(error);\n  }\n\n  ...\n```\n\nA simple example of how this works can be seen here:\n\n[http://jsfiddle.net/p6q8ghpc/](http://jsfiddle.net/p6q8ghpc/)\n\nStores in Biff also have helpers for managing the state of the store's data. Each Biff instance has `_pending` and `_errors` properties. These are exposed via getters and setters. These methods are:\n\n- getPending() - Returns store pending state\n- getErrors() - Returns store errors array\n- _setPending(arg) - Sets store pending state\n- _setError(arg) - Adds an error to the store errors array\n- _clearErrors() - Clears store errors array\n\nBelow, see an example of how they can be used:\n\n```javascript\n// In Your Store\n\nvar TodoStore = biff.createStore({\n    getTodos: function() {\n      return _todos;\n    }\n\n}, function(payload){\n\n  switch(payload.actionType) {\n    case 'ADD_START':\n      this._setPending(true);\n    break;\n\n    case 'ADD_SUCCESS':\n       this._setPending(false);\n      addTodo(payload.text);\n      this._clearErrors();\n      this.emitChange();\n    break;\n\n    case 'ADD_ERROR':\n      this._setPending(false);\n      this._setError(payload.error);\n      this.emitChange();\n    break;\n\n    default:\n      return true;\n  }\n\n  return true;\n\n});\n\n// In your component\n\nfunction getState(){\n  return {\n    errors: TodoStore.getErrors()\n    pending: TodoStore.getPending()\n    todos: TodoStore.getTodos()\n  }\n}\n\nvar TodoApp = React.createClass({\n  mixins: [TodoStore.mixin],\n  getInitialState: function () {\n    return getState();\n  },\n  storeDidChange: function () {\n    this.setState(getState());\n  }\n  ...\n\n```\n\n\n###Actions\n\nBiff's **createActions** method creates an Action Creator object with the supplied singleton object. The methods of the supplied object are given an instance of the Biff instance's dispatcher object so that you can make dispatch calls from them. It is available via `this.dispatch` in the interior of your methods.\n\nAdding actions to your app looks like this:\n\n```javascript\nvar biff = require('../biff');\n\nvar TodoActions = biff.createActions({\n  addTodo: function(text) {\n    this.dispatch({\n      actionType: 'ADD_TODO',\n      text: text\n    });\n  }\n});\n```\n\n### Async In Biff\n\nCheck out the example below to show you can handle async in Biff:\n\nhttp://jsfiddle.net/29L0anf1/\n\n## API\n\n###Biff\n\n```javascript\nvar Biff = require('biff');\n\nmodule.exports = new Biff();\n```\n\n### createStore\n\n```javascript\n/*\n * @param {object} methods - Public methods for Store instance\n * @param {function} callback - Callback method for Dispatcher dispatches\n * @return {object} - Returns instance of Store\n */\n```\n\n### createActions\n\n```javascript\n/**\n * @param {object} actions - Object with methods to create actions with\n * @constructor\n */\n```","readmeFilename":"README.md","users":{"ivanoats":true}}