Fix a bunch of eslint warnings

This commit is contained in:
Aria Minaei 2022-02-23 22:53:39 +01:00
parent 078fa7a849
commit aec6b2a251
17 changed files with 49 additions and 53 deletions

View file

@ -108,8 +108,8 @@ export default abstract class AbstractDerivation<V> implements IDerivation<V> {
* Convenience method that taps (subscribes to) the derivation using `this.changes(ticker).tap(fn)` and immediately calls
* the callback with the current value.
*
* @param ticker The ticker to use for batching.
* @param fn The callback to call on update.
* @param ticker - The ticker to use for batching.
* @param fn - The callback to call on update.
*
* @see changes
*/
@ -122,7 +122,7 @@ export default abstract class AbstractDerivation<V> implements IDerivation<V> {
/**
* Add a derivation as a dependent of this derivation.
*
* @param d The derivation to be made a dependent of this derivation.
* @param d - The derivation to be made a dependent of this derivation.
*
* @see removeDependent
*/
@ -139,7 +139,7 @@ export default abstract class AbstractDerivation<V> implements IDerivation<V> {
/**
* Remove a derivation as a dependent of this derivation.
*
* @param d The derivation to be removed from as a dependent of this derivation.
* @param d - The derivation to be removed from as a dependent of this derivation.
*
* @see addDependent
*/
@ -229,7 +229,7 @@ export default abstract class AbstractDerivation<V> implements IDerivation<V> {
* Creates a new derivation from this derivation using the provided mapping function. The new derivation's value will be
* `fn(thisDerivation.getValue())`.
*
* @param fn The mapping function to use. Note: it accepts a plain value, not a derivation.
* @param fn - The mapping function to use. Note: it accepts a plain value, not a derivation.
*/
map<T>(fn: (v: V) => T): IDerivation<T> {
return map(this, fn)
@ -248,7 +248,7 @@ export default abstract class AbstractDerivation<V> implements IDerivation<V> {
* 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.
* @param fn - The mapping function to use. Note: it accepts a plain value, not a derivation.
*/
flatMap<R>(
fn: (v: V) => R,

View file

@ -7,7 +7,7 @@ export default class ConstantDerivation<V> extends AbstractDerivation<V> {
private readonly _v: V
/**
* @param v The value of the derivation.
* @param v - The value of the derivation.
*/
constructor(v: V) {
super()

View file

@ -15,8 +15,8 @@ export default class DerivationEmitter<V> {
private _hadTappers: boolean
/**
* @param derivation The derivation to emit events for.
* @param ticker The ticker to use to batch events.
* @param derivation - The derivation to emit events for.
* @param ticker - The ticker to use to batch events.
*/
constructor(derivation: IDerivation<V>, ticker: Ticker) {
this._derivation = derivation

View file

@ -12,8 +12,8 @@ export default class DerivationFromSource<V> extends AbstractDerivation<V> {
private _hasCachedValue: boolean
/**
* @param _tapToSource A function that takes a listener and subscribes it to the underlying data source.
* @param _getValueFromSource A function that returns the current value of the data source.
* @param _tapToSource - A function that takes a listener and subscribes it to the underlying data source.
* @param _getValueFromSource - A function that returns the current value of the data source.
*/
constructor(
private readonly _tapToSource: (listener: (newValue: V) => void) => VoidFn,

View file

@ -40,8 +40,8 @@ export interface IDerivation<V> {
* Convenience method that taps (subscribes to) the derivation using `this.changes(ticker).tap(fn)` and immediately calls
* the callback with the current value.
*
* @param ticker The ticker to use for batching.
* @param fn The callback to call on update.
* @param ticker - The ticker to use for batching.
* @param fn - The callback to call on update.
*
* @see changes
*/
@ -50,7 +50,7 @@ export interface IDerivation<V> {
/**
* Add a derivation as a dependent of this derivation.
*
* @param d The derivation to be made a dependent of this derivation.
* @param d - The derivation to be made a dependent of this derivation.
*
* @see removeDependent
*/
@ -59,7 +59,7 @@ export interface IDerivation<V> {
/**
* Remove a derivation as a dependent of this derivation.
*
* @param d The derivation to be removed from as a dependent of this derivation.
* @param d - The derivation to be removed from as a dependent of this derivation.
*
* @see addDependent
*/
@ -74,7 +74,7 @@ export interface IDerivation<V> {
* Creates a new derivation from this derivation using the provided mapping function. The new derivation's value will be
* `fn(thisDerivation.getValue())`.
*
* @param fn The mapping function to use. Note: it accepts a plain value, not a derivation.
* @param fn - The mapping function to use. Note: it accepts a plain value, not a derivation.
*/
map<T>(fn: (v: V) => T): IDerivation<T>
@ -91,7 +91,7 @@ export interface IDerivation<V> {
* 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.
* @param fn - The mapping function to use. Note: it accepts a plain value, not a derivation.
*/
flatMap<R>(
fn: (v: V) => R,

View file

@ -1,5 +1,4 @@
/**
* // eslint-disable-next-line
/*
* @jest-environment jsdom
*/
import Atom from '../Atom'

View file

@ -1,5 +1,4 @@
/**
// eslint-disable-next-line
/*
* @jest-environment jsdom
*/
import Atom, {val} from '../../Atom'

View file

@ -338,7 +338,7 @@ type IPrismFn = {
* Creates a derivation from the passed function that adds all derivations referenced
* in it as dependencies, and reruns the function when these change.
*
* @param fn The function to rerun when the derivations referenced in it change.
* @param fn - The function to rerun when the derivations referenced in it change.
*/
const prism: IPrismFn = (fn) => {
return new PrismDerivation(fn)