@omkar-sheral/react-view-controller

Controller for React Component

Usage no npm install needed!

<script type="module">
  import omkarSheralReactViewController from 'https://cdn.skypack.dev/@omkar-sheral/react-view-controller';
</script>

README

react-view-controller

Controller for React Component

A pattern where Component should worry about only rendering the data. Controller will take care of providing the data to the Component and handling the events.

The idea is Component should be as dumb as possible.

Controller should be responsible for the logic.

This library delegates all life cycle callbacks of Component to Contoller. Controller then, in the life cycle callbacks, can fetch the data, attach an event listener, and work on data.

How to use

See examples.