Skip to content

🌎 Making Nullstack framework able to read any template vocable you type

License

Notifications You must be signed in to change notification settings

GuiDevloper/nullstack-polyable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nullstack Polyable

Making Nullstack framework able to read any template vocable you type

Installation

Run this command on your Nullstack project:

npm install nullstack-polyable -D

or, using Yarn:

yarn add nullstack-polyable -D

Then import it in your client.js/server.js files (as shown here in tests/index.js):

Showing usage changing element types and attributes to pt-BR

import polyable from 'nullstack-polyable';

Nullstack.use(polyable({
  types: {
    button: 'botão',
    input: 'entrada'
  },
  attributes: {
    onclick: 'aoclicar',
    oninput: 'aoteclar'
  }
}));

Examples

Everything can be seen being used on tests folder

After the configuration, the use become this:

exibe({ ação }) {
  // it will show the attribute from the element
  console.log(ação);
}

renderiza() {
  const { exibe } = this;
  return (
    <>
      <botão aoclicar={exibe} ação="clicado!">
        Clique aqui
      </botão>
      <entrada aoteclar={exibe} ação="digitado!" />
    </>
  )
}

// just to see where it goes,
// using pt-BR in lifecycle hooks and the render function
prepare = this.prepara;
console = this.exibe;
render = this.renderiza;

About

🌎 Making Nullstack framework able to read any template vocable you type

Topics

Resources

License

Stars

Watchers

Forks