Fix some TSDoc comments

This commit is contained in:
Andrew Prifer 2022-02-15 22:59:34 +01:00
parent d0ce9f7046
commit b643739ec7
2 changed files with 5 additions and 3 deletions

View file

@ -74,7 +74,7 @@ export default class Box<V> implements IBox<V> {
* Note: usages of `get()` aren't tracked, they are only for retrieving the value. To track changes, you need to
* create a derivation.
*
* @see derivation
* @see Box.derivation
*/
get() {
return this._value

View file

@ -83,11 +83,13 @@ export interface IDerivation<V> {
* by `flatMap` takes the value of that derivation.
*
* @example
* // Simply using `map()` here would return the inner derivation when we call `getValue()`
* ```ts
* // Simply using map() here would return the inner derivation when we call getValue()
* new Box(3).derivation.map((value) => new Box(value).derivation).getValue()
*
* // Using `flatMap()` eliminates the inner derivation
* // Using flatMap() eliminates the inner derivation
* new Box(3).derivation.flatMap((value) => new Box(value).derivation).getValue()
* ```
*
* @param fn The mapping function to use. Note: it accepts a plain value, not a derivation.
*/