{"name":"indefinite-observable","version":"0.0.0","scripts":{"start":"node ./devServer.js","clean":"rm -rf ./dist/*; mkdir -p ./dist/","build":"yarn run clean; $( yarn bin )/tsc; node ./build.js","prepublish":"yarn run build"},"main":"dist/index.js","browser":"dist/indefinite-observable.js","types":"src/index.ts","typescript:main":"src/index.ts","dependencies":{"symbol-observable":"1.0.4"},"devDependencies":{"pre-commit":"1.1.3","pundle-dev":"1.1.11","typescript":"2.1.1","typescript-pundle":"1.0.1"},"pre-commit":["build"],"repository":{"type":"git","url":"git+ssh://git@github.com/com%3Amaterial-motion/indefinite-observable-js.git"},"author":{"name":"The Indefinite Observable Authors","url":"see AUTHORS"},"license":"Apache-2.0","bugs":{"url":"https://github.com/com:material-motion/indefinite-observable-js/issues/"},"homepage":"https://github.com/com:material-motion/indefinite-observable-js/#readme","contributors":[{"name":"Google Inc."},{"name":"and other contributors"}],"gitHead":"57203da037c7c700c16a8fe076a23be95bef0efc","description":"[![Build Status](https://travis-ci.org/material-motion/indefinite-observable-js.svg?branch=develop)](https://travis-ci.org/material-motion/indefinite-observable-js) [![codecov](https://codecov.io/gh/material-motion/indefinite-observable-js/branch/develop/","_id":"indefinite-observable@0.0.0","_shasum":"f136831cf14f3cbf5a9a95101298b66766299bac","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"appsforartists","email":"git@appsforartists.com"},"dist":{"shasum":"f136831cf14f3cbf5a9a95101298b66766299bac","tarball":"http://registry-npm.ywwl.com/indefinite-observable/download/indefinite-observable-0.0.0.tgz","integrity":"sha512-uBdY2gIBhHEMR11ixUtr6xQPoz2BpgU4GzSkqrmfoh53C8VAtFcEwRkqLJqZgS2o4fFaxW4BX3ABA1xB+WKMeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFYkPD77pCeZRTnLiF6A1esOpeJq5ucPOf3BPcadlpxQIgCzVI5Dx980gID7fu4fb/CVrW1wIN9GOODuzwNWuOzaU="}],"size":31418,"noattachment":false,"key":"/indefinite-observable/-/indefinite-observable-0.0.0.tgz"},"maintainers":[{"name":"appsforartists","email":"git@appsforartists.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/indefinite-observable-0.0.0.tgz_1481052480864_0.47761150705628097"},"directories":{},"readme":"# Indefinite Observable #\n\n<!-- TODO: update version number before releasing, here and in the script tag -->\n[![Current version:](https://img.shields.io/badge/v2.0.1:-222222.svg?logo=npm)](https://www.npmjs.com/package/indefinite-observable/v/2.0.1)\n[![Test status](https://img.shields.io/circleci/project/github/material-motion/indefinite-observable-js/stable.svg?logo=circleci&label=Tests)](https://circleci.com/gh/material-motion/indefinite-observable-js/48)\n[![Code coverage](https://img.shields.io/codecov/c/github/material-motion/indefinite-observable-js/stable.svg?logo=codecov&logoColor=white&label=Coverage)](https://codecov.io/gh/material-motion/indefinite-observable-js/tree/f601df73be779477218f1fcf709b18e6b621de20/src)<br />\n[![HEAD:](https://img.shields.io/badge/HEAD:-222222.svg?logo=github&logoColor=white)](https://github.com/material-motion/indefinite-observable-js)\n[![Test status](https://img.shields.io/circleci/project/github/material-motion/indefinite-observable-js/develop.svg?logo=circleci&label=Tests)](https://circleci.com/gh/material-motion/indefinite-observable-js/tree/develop)\n[![Code coverage](https://img.shields.io/codecov/c/github/material-motion/indefinite-observable-js/develop.svg?logo=codecov&logoColor=white&label=Coverage)](https://codecov.io/gh/material-motion/indefinite-observable-js/branch/develop)\n\n## Why? ##\n\nThere are a lot of great Observable implementations, but they're baked into featureful libraries which contribute to both complexity and filesize.  We wanted the simplest-possible Observable implementation, with no operators, no fancy scheduling.  The entire thing is basically [three statements in `subscribe`](https://github.com/material-motion/indefinite-observable-js/blob/develop/src/IndefiniteObservable.ts#L68-L72).\n\nIndefinite Observable is a subset of the [TC39 Observable proposal](https://tc39.github.io/proposal-observable/) that never `complete`s or `error`s.  It implements the [minimal-necessary functionality](https://en.wikipedia.org/wiki/You_aren't_gonna_need_it), but it should be completely interchangeable with the TC39 proposal for the subset that it does implement.\n\nIf you want a complete Observables library that works out-of-the-box, check out [xstream](https://github.com/staltz/xstream/), [RxJS](https://github.com/ReactiveX/RxJS/), [Most](https://github.com/cujojs/most/), [Bacon](https://github.com/baconjs/bacon.js/), or [Kefir](https://github.com/rpominov/kefir/).  If you want to build your own Observables library that includes just the functionality you need, try [Indefinite Observable](https://github.com/material-motion/indefinite-observable-js/#indefinite-observable).\n\n## Usage ##\n\n```javascript\nimport { IndefiniteObservable } from 'indefinite-observable';\n\nconst moveEvent$ = new IndefiniteObservable(\n  (observer) => {\n    // Whenever you want the observable to dispatch a value, call\n    // observer.next(value).\n    element.addEventListener('pointermove', observer.next);\n\n    // Return a function that will perform any necessary clean up when the\n    // observable is unsubscribed from.\n    return () => {\n      element.removeEventListener('pointermove', observer.next);\n    }\n  }\n);\n\n// To receive the values dispatched by an observable, pass an observer to its\n// subscribe method.  An observer is just an object with a next method.\n//\n// subscribe returns a unsubscribe function.  Call that when you no longer want\n// to receive dispatches from the observable.\nconst unsubscribe = moveEvent$.subscribe({\n  next(moveEvent) {\n    console.log('got a pointer event: ', moveEvent);\n  }\n});\n```\n\nLearn more about [How Indefinite Observables work](https://material-motion.github.io/material-motion/documentation/IndefiniteObservable).\n\n## Installation ##\n\n```\nyarn add indefinite-observable\n```\n\nor include as a script tag:\n\n```html\n<script type = \"module\">\n  import { IndefiniteObservable } from \"https://ajax.googleapis.com/ajax/libs/indefinite-observable/2.0.1/indefinite-observable.bundle.js\"\n</script>\n```\n\n## Contributing ##\n\nThis library aims to be as simple as possible, so modifications will be rare.  Reasons we might make changes are limited to:\n\n- bugs, or\n- remaining compatible with the subset of the Observable spec that we support.\n\nIf you'd like to add operators, static methods, or other features, we invite you to depend upon us subclassing `IndefiniteObservable` in your own module.  In fact, [that's how we add features too](https://github.com/material-motion/material-motion-js/blob/develop/packages/core/src/observables/MotionObservable.ts).\n\nOf course, we welcome improvements to the examples and documentation in this repo.\n\n### Bundling ###\n\nOur source is available in 3 flavors: a TypeScript module, a JavaScript module, and a JavaScript bundle.  Any changes made to the first need to be reflected in the other two.  This should be handled for you automatically via a pre-commit hook.  If you have a clean working copy after committing, you're good.  If not, amend the commit with the new build before pushing.\n\nIf you need to bundle it independently, run\n\n```\nyarn run build\n```\n\n### Testing ###\n\n```\nyarn run test\n```\n\n## License ##\n\n[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n","publish_time":1481052481493,"_cnpm_publish_time":1481052481493,"dist-tags":{"latest":"2.0.1"}}