Gathering detailed insights and metrics for react-global-context-store
Gathering detailed insights and metrics for react-global-context-store
Gathering detailed insights and metrics for react-global-context-store
Gathering detailed insights and metrics for react-global-context-store
react-context-hooks-store
A simple global store based on React Context and Hooks
react-context-global-store
Global state library For React 16 Context Api
react-context-store-global
The easiest to integrate, global state management library for React based on Context API
@impact-react/store
Reactive contexts for React
Manage global state for your React app using context api
npm install react-global-context-store
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
13 Commits
1 Watchers
23 Branches
1 Contributors
Updated on Jan 02, 2020
Latest Version
1.1.0
Package Id
react-global-context-store@1.1.0
Unpacked Size
487.17 kB
Size
198.97 kB
File Count
23
NPM Version
6.7.0
Node Version
11.15.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
Manage global state for your React app using Context api
Required React Version: > 16.9
**Install react-global-context-store **
// Using yarn
$ yarn i react-global-context-store --save
// Using npm
$ npm install react-global-context-store --save
Initialize Store Context
App.js
import React from 'react'
import { StoreProvider } from "react-global-context-store";
import Counter from './Counter'
function counterReducer(state = 0, action) {
switch (action.type) {
case "INCREMENT":
return state + 1;
case "DECREMENT":
return state - 1;
default:
return state;
}
}
function App() {
let counter = 0;
return (
<StoreProvider reducer={counterReducer} initialState={counter}>
<Counter />
</StoreProvider>
);
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
Class component
Counter.js
import React, { useContext } from "react";
import StoreContext from "react-global-context-store";
function Counter() {
let [state, dispatch] = useContext(MyContext);
return (
<div>
Counter: {state} <br />
<button onClick={e => dispatch({ type: "INCREMENT" })}></button>
<button onClick={e => dispatch({ type: "DECREMENT" })}>-</button>
</div>
);
}
export default Counter;
react-global-store-context provides a connect function for you to connect your component to the store.
Normally, you’ll call connect in this way:
import { connect } from 'react-global-context-store'
import { increment, decrement } from './actionCreators'
// const Counter = ...
const mapStateToProps = (state /*, ownProps*/) => {
return {
counter: state.counter
}
}
const mapDispatchToProps = { increment, decrement, reset }
export default connect(
mapStateToProps,
mapDispatchToProps
)(Counter)
you can define async actions
const INCREMENT_COUNTER = 'INCREMENT_COUNTER';
function increment() {
return {
type: INCREMENT_COUNTER,
};
}
function incrementAsync() {
return (dispatch) => {
setTimeout(() => {
// Yay! Can invoke sync or async actions with `dispatch`
dispatch(increment());
}, 1000);
};
}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/13 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
121 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More