Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/behnammodi/react-jet
combine jetstate and jetemit for react
https://github.com/behnammodi/react-jet
javascript react react-native
Last synced: about 1 month ago
JSON representation
combine jetstate and jetemit for react
- Host: GitHub
- URL: https://github.com/behnammodi/react-jet
- Owner: behnammodi
- License: mit
- Created: 2019-01-09T06:23:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-22T11:22:46.000Z (over 3 years ago)
- Last Synced: 2024-05-21T15:32:20.880Z (6 months ago)
- Topics: javascript, react, react-native
- Language: JavaScript
- Size: 147 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-jet
Replace redux and react context
[![NPM](https://nodei.co/npm/react-jet.png)](https://nodei.co/npm/react-jet/)
[![install size](https://packagephobia.now.sh/badge?p=react-jet)](https://packagephobia.now.sh/result?p=react-jet) [![dependencies](https://david-dm.org/uxitten/react-jet.svg)](https://david-dm.org/uxitten/react-jet.svg)
# install
```npm
npm install react-jet
```# use
## Initial state
```javascript
import { initial } from 'react-jet';initial([
{
name: 'time',
defaultValue: 2018
}
]);
```## Connect to components
```javascript
import React from 'react';
import { connect } from 'react-jet';function DisplayTime(props) {
return{props.time};
}export default connect(
DisplayTime,
['time']
);
```## Change state
```javascript
import { state } from 'react-jet';state.time = 2019;
```