reciprocal

1.0.2 • Public • Published

Reciprocal

(👉 ゚ヮ゚)👉 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.


🌐 Official Docs Website coming soon.


Made with ❤️ with the ReciprocalJs team.

Package Sidebar

Install

npm i reciprocal

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

6.8 kB

Total Files

15

Last publish

Collaborators

  • squikjs