Skip to content

Commit 778748e

Browse files
committed
feat: update documentation generation
1 parent 921481b commit 778748e

36 files changed

+397
-6580
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Servable is an implementation of a "simple" observable
44

5-
![](https://badgen.net/bundlephobia/minzip/servable)
5+
![](https://badgen.net/bundlephobia/minzip/@maniator/servable)
66

77
## To install run:
88

@@ -16,4 +16,4 @@ npm i @maniator/servable --save
1616

1717
### Documentation
1818

19-
The documentation is available here: https://servable.netlify.com/
19+
The documentation is available here: https://servable.serveside.dev/

jsdoc.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": true
4+
},
5+
"source": {
6+
"include": [
7+
"src/",
8+
"./README.md"
9+
]
10+
},
11+
"plugins": ["plugins/markdown"],
12+
"opts": {
13+
"encoding": "utf8",
14+
"template": "node_modules/docdash",
15+
"destination": "./docs/",
16+
"recurse": true,
17+
"verbose": true
18+
},
19+
"markdown": {
20+
"parser": "gfm",
21+
"hardwrap": true,
22+
"idInHeadings": true
23+
},
24+
"templates": {
25+
"cleverLinks": false,
26+
"monospaceLinks": false,
27+
"default": {
28+
"outputSourceFiles": true,
29+
"includeDate": false,
30+
"useLongnameInNav": true
31+
}
32+
},
33+
"docdash": {
34+
"static": true,
35+
"sort": true,
36+
"disqus": "",
37+
"openGraph": {
38+
"title": "Servable",
39+
"type": "website",
40+
"image": "https://naftali.lubin.dev/favicon-32x32.png?v=8a370ae67443a7fd96b71aff74147006",
41+
"site_name": "Servable",
42+
"url": "https://servable.serveside.dev/"
43+
},
44+
"meta": {
45+
"title": "Servable",
46+
"description": "From scratch observable.",
47+
"keyword": "rx, rxjs, observable, es6"
48+
},
49+
"search": true,
50+
"collapse": true,
51+
"typedefs": true,
52+
"removeQuotes": "none",
53+
"scripts": [],
54+
"menu":{
55+
"Github repo":{
56+
"href":"https://github.com/maniator/servable",
57+
"target":"_blank",
58+
"class":"menu-item",
59+
"id":"repository"
60+
}
61+
}
62+
}
63+
}

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"release": "node release.js",
1414
"exampleDemo": "yarn build && yarn docs",
1515
"predocs": "rimraf docs",
16-
"docs": "documentation build src/** --format html --document-exported --theme node_modules/clean-documentation-theme -g -o docs",
16+
"docs": "jsdoc -c jsdoc.json",
1717
"serve": "npx serve"
1818
},
1919
"author": "Naftali Lubin",
@@ -33,10 +33,10 @@
3333
"@babel/cli": "7.14.8",
3434
"@babel/core": "7.15.0",
3535
"@babel/preset-env": "7.15.0",
36-
"clean-documentation-theme": "^0.5.2",
37-
"documentation": "13.2.5",
36+
"docdash": "^1.2.0",
3837
"inquirer": "^8.1.2",
3938
"jest": "27.0.6",
39+
"jsdoc": "^3.6.7",
4040
"rimraf": "^3.0.2",
4141
"rollup": "2.56.0",
4242
"rollup-plugin-babel": "4.4.0",

src/observables.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @namespace observables
3+
*/
4+
15
export * from './observables/ajax';
26
export * from './observables/fromEvent';
37
export * from './observables/fromPromise';

src/observables/ajax.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Observable } from '../Observable';
22

33
/**
44
* @private
5+
*
56
* @param {XMLHttpRequest} xhr
67
* @returns {*}
78
*/
@@ -23,11 +24,13 @@ function checkStatus (xhr) {
2324

2425
/**
2526
* Make a cancellable XHR request
26-
*
27+
*
28+
* @memberof observables
29+
*
2730
* @param {string} url
2831
* @param {string} [method]
2932
* @param {*} [requestData]
30-
* @param {{name: string, value: string}[]} [headers]
33+
* @param {Array.<{name: string, value: string}>} [headers]
3134
*
3235
* @returns {Observable}
3336
*/

src/observables/fromEvent.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { makeHot } from '../utilities/makeHot';
55
* Will create an observable that will listen for an event on a DOM element
66
*
77
* Utilizes the [`makeHot`](#makehot) method so that the event does not get reattached on every subscription
8-
*
8+
*
9+
* @memberof observables
10+
*
11+
*
912
* @param {string} eventName
1013
* @param {Element} element
1114
* @param {Function} [mapCallback]

src/observables/fromPromise.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { isPromise } from '../utilities';
33

44
/**
55
* Turns a promise into an observable that emits the value of the promise and then completes
6+
*
7+
* @memberof observables
68
*
79
* @param {Promise} promise
810
* @returns {Observable}

src/observables/interval.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Creates an interval that will count on every interval tick
5+
*
6+
* @memberof observables
57
*
68
* @param {Number} time in milliseconds to output the interval count
79
* @param {Number} [start] number to start the interval count at

src/observables/of.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { Observable } from '../Observable';
22

33
/**
44
* Takes any number of arguments and outputs them in order in an Observable stream
5-
*
6-
* @param {*[]} args
5+
*
6+
* @memberof observables
7+
*
8+
* @param {Array.<*>} args
79
* @returns {Observable}
810
*/
911
export const of = function (...args) {

src/observables/range.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Output a range of numbers to an Observable stream
5+
*
6+
* @memberof observables
57
*
68
* @param {Number} [start]
79
* @param {Number} end

src/operators.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @namespace operators
3+
*/
4+
15
export * from './operators/map';
26
export * from './operators/filter';
37
export * from './operators/delay';

src/operators/average.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Takes an average of everything coming into the event stream until it completes
5+
*
6+
* @memberof operators
57
*
68
* @param {Observable} source$
79
* @returns {Observable}

src/operators/combine.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const argsCallback = function () { return Array.from(arguments); };
88
/**
99
* combines multiple observables at the same time.
1010
* it will only call the observer's next function when all observables have emitted at least one value
11+
*
12+
* @memberof operators
1113
*
1214
* @param {Observable[]} sources$
1315
* @param {Function} combineCallback

src/operators/concat.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Concatenate any number of observables together
5+
*
6+
* @memberof operators
57
*
68
* @param {Observable} source$
79
* @param {Observable} nextSource$

src/operators/count.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { filter } from './filter';
33

44
/**
55
* Counts the number of values coming into the stream on complete
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable} source$
810
* @param {Function} [countCallback] a function to use to filter out values that you do not wish to count

src/operators/debounceTime.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { passThroughNext } from './passThroughNext';
44
/**
55
* Debounces values that will be sent down the stream.
66
* Will only output values if there has not been any new values in the past time interval passed
7+
*
8+
* @memberof operators
79
*
810
* @param {Observable} source$
911
* @param {Number} time amount of time in milliseconds

src/operators/delay.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Will delay output from the observable until a specific time interval has passed
5+
*
6+
* @memberof operators
57
*
68
* @param {Observable} source$
79
* @param {Number} time amount of time in milliseconds

src/operators/do.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { passThroughNext } from './passThroughNext';
33

44
/**
55
* Will run some callback before passing the current value to the subscription
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable} source$
810
* @param {Function} runCallback

src/operators/filter.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { passThroughNext } from './passThroughNext';
33

44
/**
55
* Will filter out values that you do not want to subscribe to
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable} source$
810
* @param {Function} filterCallback

src/operators/first.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { take } from './take';
44
/**
55
* Will take the first value from the observable and then complete
66
* This is an alias for `take(obs$, 1, callback)`
7+
*
8+
* @memberof operators
79
*
810
* @param {Observable} source$
911
* @param {Function} [filterCallback] filter out values before taking the first one

src/operators/flatMap.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { onSubscriptionsComplete } from '../utilities/onSubscriptionsComplete';
44

55
/**
66
* Same as `map(obs$, mapCallback)` but will take the value of the callback and turn it from an observable to a value
7+
*
8+
* @memberof operators
79
*
810
* @param {Observable} source$
911
* @param {Function} mapCallback

src/operators/map.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { passThroughNext } from './passThroughNext';
33

44
/**
55
* Will map each value to a new value using the callback
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable} source$
810
* @param {Function} mapCallback

src/operators/max.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Will result in the maximum value passed to the observer then will complete
5+
*
6+
* @memberof operators
57
*
68
* @param {Observable} source$
79
* @returns {Observable}

src/operators/merge.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { onSubscriptionsComplete } from '../utilities/onSubscriptionsComplete';
33

44
/**
55
* Will merge any number of observables into one observable stream
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable[]} sources$
810
* @returns {Observable}

src/operators/min.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Will result in the minimum value passed to the observer then will complete
5+
*
6+
* @memberof operators
57
*
68
* @param source$
79
* @returns {Observable}

src/operators/reduce.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { scan } from './scan';
44
/**
55
* _Sort of_ the same way that Array.reduce works, it will concatenate all of the values
66
* passing through an Observable event stream with a given scanCallback
7+
*
8+
* @memberof operators
79
*
810
* @param {Observable} source$
911
* @param {Function} scanCallback

src/operators/scan.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Observable } from '../Observable';
22

33
/**
4+
* @memberof operators
5+
*
46
* @param {Observable} source$
57
* @param {Function} scanCallback
68
* @param {*} [startValue]

src/operators/sum.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { reduce } from './reduce';
33

44
/**
55
* Sums all the values of an observable upon completion
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable} source$
810
*/

src/operators/switchMap.js

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { passThroughNextObservable } from './passThroughNextObservable';
55
* The value from the mapCallback is an observable and if another value comes through the previous observable is cancelled
66
* <br />
77
* This is useful for things like typeaheads where you dont want a request for every keypress
8+
*
9+
* @memberof operators
810
*
911
* @param {Observable} source$
1012
* @param {Function} mapCallback

src/operators/take.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { passThroughNext } from './passThroughNext';
33

44
/**
55
* Takes a number of values that satisfy the `filterCallback` then completes
6+
*
7+
* @memberof operators
68
*
79
* @param {Observable} source$
810
* @param {Number} amount

src/operators/takeUntil.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Observable } from '../Observable';
22

33
/**
44
* Takes values from the `source$` until the `takeSource$` emits one value
5+
*
6+
* @memberof operators
57
*
68
* @param {Observable} source$
79
* @param {Observable} takeSource$

src/operators/toPromise.js

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { first } from './first';
55
* Reverse of [`fromPromise`](#frompromise)
66
* <br />
77
* Converts an Observable to a promise, takes the first value and then completes
8+
*
9+
* @memberof operators
810
*
911
* @param {Observable} source$
1012
* @returns {Promise<*>}

src/operators/zip.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const startIndex = {
99
const argsCallback = function () { return Array.from(arguments); };
1010

1111
/**
12+
* @memberof operators
13+
*
1214
* @param {Observable} sources$
1315
* @param {Function} combineCallback
1416
* @returns {Observable}

0 commit comments

Comments
 (0)