Comments (3)
Essentially a dupe of #54.
There is some discussion in that ticket of why that might be a challenge too. For widgets, we essentially decided on making sure things are reactive, that not having the state would not be a problem and once the state was there, it would invalidate it.
The biggest challenge is that while initialisation could be managed async, the expectation when you create something, that it is "there". In your above example, you would then want to do something like this:
const p = createFoo();
p.then((foo1) => {
foo1.foo();
});
Which just feels like a challenge. Even with async
... await
it would still feels like that is a lot of overhead.
from compose.
Yeah, I can see the challenge too. But at the very least, the code above seems a bit cleaner than handling promises in every function where the state is needed.
Sorry I should have seen #54 before creating this one. Please feel free to close it.
from compose.
Let's move the discussion over there.
from compose.
Related Issues (20)
- Changes to Evented interfaces
- Changes to Stateful interfaces HOT 7
- Integration of dojo/interfaces
- Custom toString() is skipped by the factory HOT 1
- Additional Diagnostics HOT 3
- Proposal: Remove `.extend()` and replace with `.override()` HOT 5
- Stateful should emit a `state:initialized`
- Stateful should emit an initialization event HOT 1
- Stateful should emit "error" on observation error HOT 1
- Once initialized event has been emitted, subsequent events do not need to async HOT 1
- Events should not emit on the next turn and `state:initialized` is no longer required HOT 1
- Event globbing with Evented HOT 1
- Typescript 2.1 Merge Types HOT 2
- Remove deprecated `mixins` HOT 1
- Consider splitting createStateful HOT 1
- TypeScript 2.2 Object and Intersection Types HOT 2
- Update README to better reflect current design and usage
- API Doc Review for compose
- Upgrade to typescript 2.3.2
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 compose.