Skip to content

Commit e549db5

Browse files
committed
docs(Symbol.observable): improve docs around observable interop method as per request
1 parent f99c2ba commit e549db5

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/createStore.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,22 @@ export default function createStore(reducer, initialState, enhancer) {
200200
}
201201

202202
/**
203-
* Interop point for observable libraries
204-
* @returns {observable} minimal observable of state changes. This was added for Interop
205-
* For more information, see the
206-
* [observable proposal](https://github.com/zenparsing/es-observable)
203+
* Interoperability point for observable/reactive libraries.
204+
* @returns {observable} A minimal observable of state changes.
205+
* For more information, see the observable proposal:
206+
* https://github.com/zenparsing/es-observable
207207
*/
208208
function observable() {
209209
var outerSubscribe = subscribe
210210
return {
211+
/**
212+
* The minimal observable subscription method.
213+
* @param {Object} observer Any object that can be used as an observer.
214+
* The observer object should have a `next` method.
215+
* @returns {subscription} An object with an `unsubscribe` method that can
216+
* be used to unsubscribe the observable from the store, and prevent further
217+
* emission of values from the observable.
218+
*/
211219
subscribe(observer) {
212220
if (typeof observer !== 'object') {
213221
throw new TypeError('Expected observer to be an object')

0 commit comments

Comments
 (0)