datner/acquire disposable#6209
Conversation
I would've used `strictEquals` but it does not use the `Equals` trait despite claiming it does
🦋 Changeset detectedLatest commit: 27ba280 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| * | ||
| * @see {@link acquireRelease} for more information about scopes. | ||
| * | ||
| * @since 3.0.0 |
| ): Effect.Effect<A, E, R | Scope.Scope> | ||
| } = (acquire) => | ||
| acquireRelease(acquire, (resource) => | ||
| Predicate.hasProperty(resource, Symbol.asyncDispose) |
There was a problem hiding this comment.
Hi! I just had a thought.
What if an object has both Dispose symbols—why does the asynchronous one take priority?
Maybe it would make sense to split this function into two, or allow configuring the priority?
There was a problem hiding this comment.
maybe the assumption is that if there is an async one the sync doesn't wait?
There was a problem hiding this comment.
If it has both dispose symbols, are both invoked? In which order?
The mdn suggests that async always takes priority and is even valid for sync cases, but I can't find a definition of behavior for using both symbols... Open to suggestions 🤷🏻
Effect.acquireDisposableEffect.acquireDisposableassertTrue(equalstoassertEquals