{ "name": "dom-reduce", "id": "dom-reduce", "version": "1.0.0", "description": "Reducible DOM APIs", "keywords": [ "dom", "reduce", "reducers", "reducible", "stream", "FRP", "functional", "reactive", "signal", "event" ], "author": { "name": "Irakli Gozalishvili", "email": "rfobic@gmail.com", "url": "http://jeditoolkit.com" }, "homepage": "https://github.com/Gozala/dom-reduce", "repository": { "type": "git", "url": "https://github.com/Gozala/dom-reduce.git", "web": "https://github.com/Gozala/dom-reduce" }, "bugs": { "url": "http://github.com/Gozala/dom-reduce/issues/" }, "dependencies": { "reducible": "~1.0.1" }, "devDependencies": { "test": "~0.5.0", "phantomify": "~0.x.0", "reducers": "~2.0.0" }, "main": "./index.js", "scripts": { "test": "node ./node_modules/phantomify/bin/cmd.js ./test/index.js", "repl": "node node_modules/repl-utils", "postinstall": "npm dedup" }, "licenses": [ { "type": "MIT", "url": "https://github.com/Gozala/dom-reduce/License.md" } ], "readme": "# dom-reduce\n\n[![Build Status](https://secure.travis-ci.org/Gozala/dom-reduce.png)](http://travis-ci.org/Gozala/dom-reduce)\n\nSmall library for dealing with browser DOM events in a [reducible][reducers]\nstyle. This lets operate on user events as with regular collection data\nstructures in composable manner.\n\n## Usage\n\n```js\nvar open = require(\"dom-reduce/event\")\nvar map = require(\"reducers/map\")\nvar filter = require(\"reducers/filter\")\nvar fold = require(\"reducers/fold\")\nvar takeWhile = require(\"reducers/take-while\")\n\n// Take stream of mouse move events.\nvar moves = open(document.documentElement, \"mousemove\")\n// Map it to the axis positions\nvar axis = map(moves, function(event) {\n return { x: event.clientX, y: event.clientY }\n})\n// Filter down to the area we're interested in.\nvar lineAxis = filter(axis, function(value) {\n return value.x > 190 && value.x < 200\n})\n\n// Take positions only until mouse reaches the edge.\n// Note that when this contidion is met event listeners\n// will automatically be removed.\nvar values = takeWhile(lineAxis, function(value) {\n return value.y > 0\n})\n\n// Drow sowething in the given range.\nfold(lineAxis, function(position) {\n draw(position)\n})\n```\n\n## Install\n\n npm install dom-reduce\n\n## Develop\n\nLibrary is developed using awesome [browserify][]! [Phantomify][] is used\nfor running test in a [PhantomJS][].\n\n[reducers]:https://github.com/Gozala/reducers\n[browserify]:https://github.com/substack/node-browserify\n[phantomify]:https://github.com/Gozala/phantomify\n[phantomjs]:https://github.com/ariya/phantomjs\n", "readmeFilename": "Readme.md", "_id": "dom-reduce@1.0.0", "_from": "dom-reduce" }