Samples here
fponticelli / doom-bootstrap Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Samples here
What if all BS components followed a common convention for the "create" functions:
public static function create(required api values, ?optional api values, required state values, ?optional state values, ?api, ?state, ?children) {
// construct
}
So a button might look like:
class Button extends Component<ButtonApi, ButtonState> {
public static function create(onClick, buttonStyle, ?buttonSize, ?api, ?state, ?children) : Button {
if (api == null) api = /* create default api obj */;
api.onClick = onClick;
// optional api things
if (state == null) state = /* create default state obj */;
state.style = buttonStyle;
// etc.
return new Button(api, state, children);
}
}
I thought it would be useful to have a list of components to implement...
E.g. if you have a Button component which has it's own state object, the render method only has access to the values defined in state
. What if you wanted to add your own custom class to the button component?
Should all component state typedefs extend from a common base "state" for components, which allows for extra things like classes, attributes, id, etc.?
typedef ComponentState = {
classes: String,
id: String,
attributes: Map<String, AttributeValue>,
// ?
};
// then for something like Button:
typedef ButtonState = { > ComponentState,
style: ButtonStyle,
size: ButtonSize,
// etc.
}
You could also do the same type of thing for APIs, so common events don't have to be duplicated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.