var-jsx

1.1.1 • Public • Published

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i var-jsx

Weekly Downloads

11

Version

1.1.1

License

ISC

Unpacked Size

26.2 kB

Total Files

5

Last publish

Collaborators

  • exmuh