Skip to content

Commit

Permalink
Re-expose InteropObservable and InteropSubscribable (#4712)
Browse files Browse the repository at this point in the history
* Expose InteropObservable and InteropSubscribable

* Changeset

* make `MachineImplementationsSimplified` hidden

* Update packages/core/src/types.ts

Co-authored-by: Mateusz Burzyński <[email protected]>

* Update packages/core/src/types.ts

Co-authored-by: Mateusz Burzyński <[email protected]>

* Update .changeset/slow-swans-punch.md

Co-authored-by: Mateusz Burzyński <[email protected]>

* Update packages/core/src/types.ts

---------

Co-authored-by: Mateusz Burzyński <[email protected]>
  • Loading branch information
davidkpiano and Andarist authored Jan 31, 2024
1 parent 25038c1 commit 2f1d36a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/slow-swans-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate': patch
---

Ensure that `InteropObservable` and `InteropSubscribable` are present in the type definition file.
8 changes: 1 addition & 7 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ export type DelayConfig<

// TODO: possibly refactor this somehow, use even a simpler type, and maybe even make `machine.options` private or something
/**
* @internal
* @hidden
*/
export interface MachineImplementationsSimplified<
TContext extends MachineContext,
Expand Down Expand Up @@ -1879,16 +1879,10 @@ export interface Subscription {
unsubscribe(): void;
}

/**
* @internal
*/
export interface InteropObservable<T> {
[Symbol.observable]: () => InteropSubscribable<T>;
}

/**
* @internal
*/
export interface InteropSubscribable<T> {
subscribe(observer: Observer<T>): Subscription;
}
Expand Down

0 comments on commit 2f1d36a

Please sign in to comment.