{"map":"{\"version\":3,\"file\":\"IndefiniteSubject.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/observables/IndefiniteSubject.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EACL,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,2BAA2B,GAC5B,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,wBAA4B,SAAQ,2BAA8B;IAAxE;;QAEE,gBAAW,GAAY,KAAK,CAAC;IAiC/B,CAAC;IA/BC;;;;OAIG;IACH,IAAI,CAAC,KAAQ;QACX,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAE3B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,cAAiC;QACzC,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAErD,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YACrB,UAAU,CAAC,cAAc,CAAC;kBACtB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;kBACvC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,CAAC,YAAY,CAAC;IACtB,CAAC;CACF;AACD,eAAe,iBAAiB,CAAC\"}","code":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nimport { isObserver, } from '../typeGuards';\r\nimport { MemorylessIndefiniteSubject, } from './MemorylessIndefiniteSubject';\r\n/**\r\n * An `IndefiniteSubject` is both an `Observer` and an `Observable`.  Whenever\r\n * it receives a value on `next`, it forwards that value to any subscribed\r\n * observers.\r\n *\r\n * `IndefiniteSubject` also remembers the most recent emission and passes it to\r\n * any new subscriber.\r\n */\r\nexport class IndefiniteSubject extends MemorylessIndefiniteSubject {\r\n    constructor() {\r\n        super(...arguments);\r\n        this._hasStarted = false;\r\n    }\r\n    /**\r\n     * Passes the supplied value to any currently-subscribed observers.  If an\r\n     * observer `subscribe`s before `next` is called again, it will immediately\r\n     * receive `value`.\r\n     */\r\n    next(value) {\r\n        this._hasStarted = true;\r\n        this._lastEmission = value;\r\n        super.next(value);\r\n    }\r\n    /**\r\n     * `subscribe` accepts either a function or an object with a next method.\r\n     * `subject.next` will forward any value it receives to the function or method\r\n     * provided here.\r\n     *\r\n     * Call the returned `unsubscribe` method to stop receiving values on this\r\n     * particular observer.\r\n     */\r\n    subscribe(observerOrNext) {\r\n        const subscription = super.subscribe(observerOrNext);\r\n        if (this._hasStarted) {\r\n            isObserver(observerOrNext)\r\n                ? observerOrNext.next(this._lastEmission)\r\n                : observerOrNext(this._lastEmission);\r\n        }\r\n        return subscription;\r\n    }\r\n}\r\nexport default IndefiniteSubject;\r\n//# sourceMappingURL=IndefiniteSubject.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/observables/IndefiniteSubject.d.ts","text":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nimport { ObserverOrNext, Subscription } from 'indefinite-observable';\r\nimport { MemorylessIndefiniteSubject } from './MemorylessIndefiniteSubject';\r\n/**\r\n * An `IndefiniteSubject` is both an `Observer` and an `Observable`.  Whenever\r\n * it receives a value on `next`, it forwards that value to any subscribed\r\n * observers.\r\n *\r\n * `IndefiniteSubject` also remembers the most recent emission and passes it to\r\n * any new subscriber.\r\n */\r\nexport declare class IndefiniteSubject<T> extends MemorylessIndefiniteSubject<T> {\r\n    _lastEmission: T;\r\n    _hasStarted: boolean;\r\n    /**\r\n     * Passes the supplied value to any currently-subscribed observers.  If an\r\n     * observer `subscribe`s before `next` is called again, it will immediately\r\n     * receive `value`.\r\n     */\r\n    next(value: T): void;\r\n    /**\r\n     * `subscribe` accepts either a function or an object with a next method.\r\n     * `subject.next` will forward any value it receives to the function or method\r\n     * provided here.\r\n     *\r\n     * Call the returned `unsubscribe` method to stop receiving values on this\r\n     * particular observer.\r\n     */\r\n    subscribe(observerOrNext: ObserverOrNext<T>): Subscription;\r\n}\r\nexport default IndefiniteSubject;\r\n"}}
