👉 ゚ヮ゚)👉 A simple web framework that converts JSON objects to html elements.
(
📁 Installation
Using npm
or yarn
:
# Using NPM
npm install reciprocal
# Using YARN
yarn add reciprocal
📚 Sample Usage
import { Reciprocal } from './node_modules/reciprocal/reciprocal.js'; // path is relative
// Title component
class Title {
render = ({ string }) => {
// Accepting string as argument which will be passed while rendering
return {
h1: {
// Making a `h1` element with class `title`
class: 'title',
children: [string],
},
};
};
}
// Main app
class App {
render = () => {
return {
Title: { string: 'I am a title!' },
};
};
}
/* The first argument is the main app which will be rendered.
The second argument is the list of components which will be used by the main app.*/
Reciprocal.render(new App().render(), { Title });
// OR
Reciprocal.renderClass(App, { Title });
Sample usage is also given in the
sample
folder.