Skip to content

endurance/behavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Simple React Behavior Pattern

A way of simplifying frontend logic
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

This repository is dedicated to resolving some of the issues I've seen in my time writing thousands of React components, both alone and on teams.

In particular, I've noticed that many engineers struggle with separation of concerns on the frontend, or even decide that all logic - complicated or otherwise - belongs in the Component itself.

The examples and patterning in this repository is an attempt to bring simple code separation into the React community.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Installation

npm i @enduranceidehen/behavior

Usage

Please refer to the Documentation

Tips

  1. Don't extend or inherit from behaviors.
  • Problem: Creating an inheritance hierachy can come with a whole host of complexity problems.
  • Try this: Consider Behaviors as place to separate view code (which can live in the React Component) from logic, which the Behavior exists to encapsulate.
  • If you have common functionality that you want to reuse, turn that functionality into a separate function that you reuse in the behavior in service to the component.
  1. Make your behaviors as simple as you can possibly make it

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Your Name - Endurance Idehen - jeidehen@gmail.com

Project Link: https://github.com/endurance/behavior