mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
stream: Remove tslint
This commit is contained in:
parent
d6bf4055a6
commit
f355f63df9
@ -1,4 +1,3 @@
|
|||||||
// tslint:disable:readonly-array no-submodule-imports
|
|
||||||
import { Producer, Stream } from "xstream";
|
import { Producer, Stream } from "xstream";
|
||||||
|
|
||||||
import { concat } from "./concat";
|
import { concat } from "./concat";
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// tslint:disable:readonly-array
|
|
||||||
import { Producer, Stream, Subscription } from "xstream";
|
import { Producer, Stream, Subscription } from "xstream";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,7 +30,6 @@ export function concat<T>(...streams: Stream<T>[]): Stream<T> {
|
|||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line:no-object-mutation
|
|
||||||
queues.length = 0;
|
queues.length = 0;
|
||||||
completedStreams.clear();
|
completedStreams.clear();
|
||||||
activeStreamIndex = 0;
|
activeStreamIndex = 0;
|
||||||
|
@ -29,7 +29,6 @@ describe("DefaultValueProducer", () => {
|
|||||||
const producer = new DefaultValueProducer(42);
|
const producer = new DefaultValueProducer(42);
|
||||||
const stream = Stream.createWithMemory(producer);
|
const stream = Stream.createWithMemory(producer);
|
||||||
|
|
||||||
// tslint:disable-next-line:readonly-array
|
|
||||||
const events: number[] = [];
|
const events: number[] = [];
|
||||||
stream.addListener({
|
stream.addListener({
|
||||||
next: (value) => {
|
next: (value) => {
|
||||||
@ -68,7 +67,6 @@ describe("DefaultValueProducer", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("calls callbacks", async () => {
|
it("calls callbacks", async () => {
|
||||||
// tslint:disable-next-line:readonly-array
|
|
||||||
const producerActive: boolean[] = [];
|
const producerActive: boolean[] = [];
|
||||||
|
|
||||||
const producer = new DefaultValueProducer(42, {
|
const producer = new DefaultValueProducer(42, {
|
||||||
|
@ -12,9 +12,7 @@ export class DefaultValueProducer<T> implements Producer<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private readonly callbacks: DefaultValueProducerCallsbacks | undefined;
|
private readonly callbacks: DefaultValueProducerCallsbacks | undefined;
|
||||||
// tslint:disable-next-line:readonly-keyword
|
|
||||||
private internalValue: T;
|
private internalValue: T;
|
||||||
// tslint:disable-next-line:readonly-keyword
|
|
||||||
private listener: Listener<T> | undefined;
|
private listener: Listener<T> | undefined;
|
||||||
|
|
||||||
public constructor(value: T, callbacks?: DefaultValueProducerCallsbacks) {
|
public constructor(value: T, callbacks?: DefaultValueProducerCallsbacks) {
|
||||||
@ -29,7 +27,6 @@ export class DefaultValueProducer<T> implements Producer<T> {
|
|||||||
* If not, just the current value is updated.
|
* If not, just the current value is updated.
|
||||||
*/
|
*/
|
||||||
public update(value: T): void {
|
public update(value: T): void {
|
||||||
// tslint:disable-next-line:no-object-mutation
|
|
||||||
this.internalValue = value;
|
this.internalValue = value;
|
||||||
if (this.listener) {
|
if (this.listener) {
|
||||||
this.listener.next(value);
|
this.listener.next(value);
|
||||||
@ -49,7 +46,6 @@ export class DefaultValueProducer<T> implements Producer<T> {
|
|||||||
* Called by the stream. Do not call this directly.
|
* Called by the stream. Do not call this directly.
|
||||||
*/
|
*/
|
||||||
public start(listener: Listener<T>): void {
|
public start(listener: Listener<T>): void {
|
||||||
// tslint:disable-next-line:no-object-mutation
|
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
listener.next(this.internalValue);
|
listener.next(this.internalValue);
|
||||||
|
|
||||||
@ -65,8 +61,6 @@ export class DefaultValueProducer<T> implements Producer<T> {
|
|||||||
if (this.callbacks) {
|
if (this.callbacks) {
|
||||||
this.callbacks.onStop();
|
this.callbacks.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line:no-object-mutation
|
|
||||||
this.listener = undefined;
|
this.listener = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// tslint:disable:readonly-array
|
|
||||||
|
|
||||||
import { Producer, Stream } from "xstream";
|
import { Producer, Stream } from "xstream";
|
||||||
|
|
||||||
import { firstEvent, fromListPromise, toListPromise } from "./promise";
|
import { firstEvent, fromListPromise, toListPromise } from "./promise";
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// tslint:disable:readonly-array
|
|
||||||
import { Stream } from "xstream";
|
import { Stream } from "xstream";
|
||||||
|
|
||||||
import { asArray, countStream, lastValue } from "./reducer";
|
import { asArray, countStream, lastValue } from "./reducer";
|
||||||
|
@ -1,14 +1,3 @@
|
|||||||
/*
|
|
||||||
This file maintains some stream helpers used in iov-bns, but which
|
|
||||||
may be useful other places, and should consider to be moved.
|
|
||||||
|
|
||||||
Reducer and related code works to maintain a current state
|
|
||||||
materialized by reducing all events on a stream. Similar
|
|
||||||
to ValueAndUpdate in keycontrol, but more general.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// tslint:disable:readonly-keyword
|
|
||||||
// tslint:disable:no-object-mutation
|
|
||||||
import { Stream } from "xstream";
|
import { Stream } from "xstream";
|
||||||
|
|
||||||
export type ReducerFunc<T, U> = (acc: U, evt: T) => U;
|
export type ReducerFunc<T, U> = (acc: U, evt: T) => U;
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tslint.json"
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user