Files
bytedance--flowgram.ai/packages/variable-engine/variable-core/src/utils/toDisposable.tsx
T
wehub-resource-sync 0232b4e2bb
CI / build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:09:51 +08:00

17 lines
451 B
TypeScript

/**
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
* SPDX-License-Identifier: MIT
*/
import { Subscription } from 'rxjs';
import { Disposable } from '@flowgram.ai/utils';
/**
* Convert rxjs subscription to disposable
* @param subscription - The rxjs subscription
* @returns The disposable
*/
export function subsToDisposable(subscription: Subscription): Disposable {
return Disposable.create(() => subscription.unsubscribe());
}