Comments (7)
I wonder if it should be possible to provide state that isn't actually stored anywhere?
Turns out it is, yay!
from widget-core.
Refs #45 in that what we need to do here will essentially effect that as well as #35 to a minor degree.
from widget-core.
Following up from dojo/app#20 (via dojo/widgets#30), should it be possible to specify classes
at instantiation time without specifying them in the state?
I suppose these too could be considered "static" and added after getting the widget classes. Then any dynamic stuff needs to come from the state.
from widget-core.
classes
and styles
have been removed as options for widgets and the only way to specify classes outside of statically in the widget is via state
, so in answer I don't think so.
from widget-core.
@agubler that makes dojo/app#20 really hard to implement. I wonder if it should be possible to provide state
that isn't actually stored anywhere? Otherwise App will have to create IDs for all widgets it instantiates, and might just have to require a default widget store.
I'm actually bringing this up since I'm looking to simplify the dataviz
behavior around this kind of config. Sounds like the idea is that you can specify defaults on the class level, and allow customization via state. So I'll try to make that work.
from widget-core.
Turns out it is, yay!
The only caveat/edge case that I don't think we have handled is that if .observeState()
after creation, the "local" state will be patched with the observed state, which might result in some surprises. We could change it that the first thing it does when observing state is that it takes any local state and patches that before it starts observing. I suspect that is all a bit of an edge case though.
from widget-core.
The only caveat/edge case that I don't think we have handled is that if .observeState() after creation, the "local" state will be patched with the observed state, which might result in some surprises. We could change it that the first thing it does when observing state is that it takes any local state and patches that before it starts observing. I suspect that is all a bit of an edge case though.
Would be good to avoid surprises like this.
from widget-core.
Related Issues (20)
- Do not default `lang` attribute to null as this causes failing a11y audits
- Change Registry to accept a functional Injector Factory over the existing Injector Instance
- WebAnimation down not work on IE11 HOT 3
- Readme should mention polyfills where needed
- Move JSX types to local namespace HOT 1
- Re-render using dom() doesn't replace the DOM element HOT 1
- Animations do not get executed for DOM nodes when a widget is added or removed.
- [Projector#merge] Existing CSS classes are not preserved when topmost render toggles rendering
- [QUESTION] Add data-attribute to simple div HOT 2
- Benchmarks are not running correclty
- Node ordering incorrect when returning DNode[] HOT 9
- Views for multiple routes seen at once HOT 2
- Meta after renders are not run when a widget uses the after render decorator
- Diff Property should have access to the full previous and current properties
- Render `key` as dom property in `debug` mode
- extraClasses crashes your app if class names contain leading or trailing whitespace HOT 3
- Intersection meta passes unbound function to createHandle
- How do you animate with nodes across widgets? HOT 2
- dojo/widget-core typo in code snippet
- Debugging Issue in ThemedMixin
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 widget-core.