1.0.0 • Published 6 years ago

unstated7 v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Unstated7

This is the same thing as that, it goes without saying.

Overview

Unstated7 is a small and lightweight library for React. Unstated7 provides you great features as Unstated, except Provider and Promise though.

Unstated:

If you're like me, you're sick of all the ceremony around state management in React. Something that fits in well with the React way of thinking, but doesn't command some crazy architecture and methodology.

Component state is nice! It makes sense and people pick it up quickly:
・・・
As a new React developer you might not know exactly how everything works, but you can get a general sense pretty quickly.

The only problem here is that we can't easily share this state with other components in our tree. Which is intentional! React components are designed to be very self-contained.

What would be great is if we could replicate the nice parts of React's component state API while sharing it across multiple components.

But how do we share values between components in React? Through "context".
・・・
This is already pretty great. Once you get a little bit used to React's way of thinking, it makes total sense and it's very predictable.

But can we build on this pattern to make something even nicer?
・・・
Well this is where Unstated comes in.

Installing

Unstated7 fully supports in-browser, NodeJS (, Electron) , Browserify... usage. If you are using Unstated7 in your browser, simply include the script:

Browser

<script src="unstated7.js"></script>

Or use CDN:

<script src="https://unpkg.com/unstated7@latest/unstated7.js"></script>

NodeJS, etc.

Copy unstated7.js your PC, or run the following:

npm install unstated7

Simply use the Unstated7 module as you would any other module:

var unstated7 = require("unstated7.js");

Usage

See attached sample HTML files. This samples make sense to you if you are a React and Unstated user.

Contribution

  1. Fork it
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create new Pull Request

License

MIT

1.0.0

6 years ago