Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Avivbens committed Dec 29, 2023
1 parent 5a91c68 commit 4834473
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './public-api';
export * from './public-api'
3 changes: 2 additions & 1 deletion src/parallel/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IExecutionOptions } from '../models/execution-options.model'
/* eslint-disable @typescript-eslint/no-empty-function */
import type { IExecutionOptions } from '../models/execution-options.model'

export const DEFAULT_EXECUTION_OPTIONS: Required<Omit<IExecutionOptions, 'payload' | 'handler'>> = {
concurrency: 1,
Expand Down
9 changes: 5 additions & 4 deletions src/parallel/parallel.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { Subject, debounceTime, finalize, skip, take, tap } from 'rxjs'
import { Parallel } from './parallel.service'

Expand Down Expand Up @@ -73,11 +74,11 @@ describe('Parallel', () => {
const failFn = jest.fn()
const payload = Array.from({ length: 1000 }, (_, i) => i)
const length = payload.length
const concurrency: number = 100
const concurrency = 100

const checker$ = new Subject()
const expectedChunksTriggered = length / concurrency
let chunksTriggered: number = 0
let chunksTriggered = 0

checker$
.asObservable()
Expand Down Expand Up @@ -119,7 +120,7 @@ describe('Parallel', () => {
const payload = [0, 1, 2, 3]
const length = payload.length

// @ts-ignore
// @ts-expect-error
const { callsPipe, execution$ } = Parallel._createExecution<number, void>(
payload,
async (p) => {
Expand Down Expand Up @@ -156,7 +157,7 @@ describe('Parallel', () => {
const payload = [0, 1, 2, 3]
const length = payload.length

// @ts-ignore
// @ts-expect-error
const { callsPipe, execution$ } = Parallel._createExecution<number, void>(
payload,
async (p) => {
Expand Down
5 changes: 3 additions & 2 deletions src/parallel/parallel.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { merge } from 'lodash'
import { Subject, Subscription, filter, finalize, skip, switchMap, take, tap } from 'rxjs'
import { IExecutionOptions, ProcessDirection } from '../models/execution-options.model'
import type { IExecutionOptions, ProcessDirection } from '../models/execution-options.model'
import { DEFAULT_EXECUTION_OPTIONS } from './default'

export class Parallel {
Expand All @@ -10,7 +10,7 @@ export class Parallel {
*/
public static execute<T = unknown, K = unknown>(options: IExecutionOptions<T, K>): Subscription {
const { onDone, onItemDone, onItemFail, handler, payload, processDirection, concurrency } = merge<
{},
object,
Required<Omit<IExecutionOptions, 'payload' | 'handler'>>,
IExecutionOptions<T, K>
>({}, DEFAULT_EXECUTION_OPTIONS, options)
Expand All @@ -34,6 +34,7 @@ export class Parallel {
)
.subscribe()

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const pipes: Subject<T>[] = firstItems.map((item) => {
const { execution$, callsPipe } = this._createExecution<T, K>(
payload,
Expand Down

0 comments on commit 4834473

Please sign in to comment.