var-jsx
v1.1.1
Published
It's jsx translator that can easily be used ```js const {jsx} = require(`jsx`); ``` it's done!\ now you can use `jsx.translate` to translate ```js jsx.translate(`const a = <div>hi!</div>`); ``` ```js const a = Var.make(`a`,[],Var.text(`hi!`));
Downloads
15
Readme
Var - Jsx
It's jsx translator that can easily be used
const {jsx} = require(`jsx`);
it's done!
now you can use jsx.translate
to translate
jsx.translate(`const a = <div>hi!</div>`);
const a = Var.make(`a`,[],Var.text(`hi!`));
you can also customize the returning code
jsx.setting = {
"domMaker" : "make",
"textMaker" : "text",
"stateMaker" : "state",
"changeMaker" : "change"
}
if you want to use variables, try this
const a = <div><-variable-></div>;
const a = Var.make(`div`,[],Var.change(variable));
domMaker
dom maker function is the function that should function as making virtual dom\
const domMakerName = (name,states, ...child) => {
//name : string
//states : Array<{name, date}>
//...child : virtualDom
};
textMaker
textMaker function should function as making text virtual dom
const textMakerName = (data) => {
//data : string
};
stateMaker
stateMaker function should function as making state
const stateMakerName = (name,data) => {
//name : string
//data : string
}
changeMaker
changeMaker function should function
as change variable (whose type isn't virtualDom) to virtualDom
const changeMakerName = (data) => {
//data : any
}