Comments (9)
After talking to @rwjblue, it sounds like native is fine if you don't support IE11 (makes sense). We should probably use PromiseLike<T>
, instead. Just trying to figure out the optimal return type.
from ember-test-waiters.
Thanks, @NullVoxPopuli. I could be wrong, but I think the issue here is you're trying to intermix native and RSVP promises.
https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/app/services/toast.ts#L57
You're not importing RSVP promise in this service, but rather using native promises, so waitForPromise
will error due to a type mismatch.
from ember-test-waiters.
waitForPromise will error due to a type mismatch.
right, but waitForPromise is compat with native Promises, so the types should be updated, yeah?
PR: #130
from ember-test-waiters.
We specifically import RSVP.Promise
and use that in waitForPromise
. So I'm not sure that's true?
from ember-test-waiters.
We additionally specifically use RSVP.Promise
in our tests, so we're not testing for native promises.
from ember-test-waiters.
sure, but isn't RSVP.Promise pretty much a polyfill at this point? the APIs are the same
from ember-test-waiters.
like, should I not use waitForPromise
/ ember-test-waiters if I want to use native promises? seems weird to need to fork the repo for a type error :-\
I s`pose I could add tests for native promises?
from ember-test-waiters.
Looking at this again, and playing with it a while, I think we should stick with what you have. If we use PromiseLike<T>
, that interface doesn't include catch
and finally
. That means that we'd be narrowing the return type from waitForPromise
, which isn't what we want to be doing.
from ember-test-waiters.
Resolved with #130
from ember-test-waiters.
Related Issues (20)
- Missing type definitions for `@ember/test-waiters` HOT 5
- Investigate CI failure HOT 1
- maybe an embroider compatibility issue? can't find module HOT 14
- Minimize the production impact HOT 4
- waitFor: HOT 9
- Glimmer Standalone HOT 2
- @Waitfor does not work as promised HOT 3
- forceHighlanderAddon is not safe under embroider HOT 3
- TS Files appear to be published
- extra files published
- release major version HOT 3
- add embroider scenarios HOT 1
- [waitFor ember-concurrency interopt failing] in ember 3.16 + ember 3.20 likely do to ember-concurrency HOT 2
- @waitFor label
- Build error with embroider HOT 2
- Runloop compatible `waitFor` type
- Quest: Prep for v4: V2 Addon conversion
- `waiter.nextToken` needs to be added to the production Noop waiter HOT 1
- Look in to using `@embroider/macros` for better production stripping HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-test-waiters.