Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove bindCallback workaround #6063

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/internal/observable/bindCallback.ts
Expand Up @@ -2,7 +2,6 @@
import { SchedulerLike } from '../types';
import { Observable } from '../Observable';
import { bindCallbackInternals } from './bindCallbackInternals';
import { TS_IncompatibleSignature } from '../util/workarounds';

// tslint:disable:max-line-length
/** @deprecated resultSelector is no longer supported, use a mapping function. */
Expand Down Expand Up @@ -142,7 +141,7 @@ export function bindCallback<A extends readonly unknown[], R extends readonly un
* Observable that delivers the same values the callback would deliver.
*/
export function bindCallback(
callbackFunc: TS_IncompatibleSignature,
callbackFunc: (...args: [...any[], (...res: any) => void]) => void,
resultSelector?: ((...args: any[]) => any) | SchedulerLike,
scheduler?: SchedulerLike
): (...args: any[]) => Observable<unknown> {
Expand Down
3 changes: 1 addition & 2 deletions src/internal/observable/bindNodeCallback.ts
Expand Up @@ -2,7 +2,6 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
import { bindCallbackInternals } from './bindCallbackInternals';
import { TS_IncompatibleSignature } from '../util/workarounds';

/** @deprecated resultSelector is deprecated, pipe to map instead */
export function bindNodeCallback(
Expand Down Expand Up @@ -122,7 +121,7 @@ export function bindNodeCallback<A extends readonly unknown[], R extends readonl
* deliver.
*/
export function bindNodeCallback(
callbackFunc: TS_IncompatibleSignature,
callbackFunc: (...args: [...any[], (err: any, ...res: any) => void]) => void,
resultSelector?: ((...args: any[]) => any) | SchedulerLike,
scheduler?: SchedulerLike
): (...args: any[]) => Observable<any> {
Expand Down
5 changes: 0 additions & 5 deletions src/internal/util/workarounds.ts
Expand Up @@ -3,8 +3,3 @@
// Wherever possible, use a TypeScript issue number in the type - something
// like TS_18757 - or use a descriptive name and leave a detailed comment
// alongside the type alias.

// When TypeScript was bumped to version 4.2, there was an issue with
// signatures being deemed incompatible when they ought to be compatible.
// Really, any function should be compatible with `(...args: any[]) => void`.
export type TS_IncompatibleSignature = any;