Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
ground-control
Advanced tools
Scalable reducer management and data fetching for React Router / Redux.
IMPORTANT! This a beta! Use cautiously until we release 1.0 (then strict semver)! Tests coming...
GroundControl simplifies React-Router/Redux single page applications:
<Router
history={browserHistory}
render={(props) => (
<GroundControl {...props} store={store} />
)}>
<Route path="/" reducer={rootReducer}>
<IndexRoute reducer={indexReducer} />
<Route path="/route-1" reducer={route1Reducer} />
</Route>
</Router>
Demo Clone & npm i && npm start
.
Install npm install ground-control --save-dev
Declare a reducer as a property on your routes. Global application state will automatically build. When a nested route changes, that level of state will clear, and reducers replaced...
{
groundcontrol: {
self: { currentUser }, // path: "/" -- root component / layout.
child: {
self: { items }, // path: "/items" -- 1st level route.
child: {
self: { item }, // path: "/items/:id" -- nested
},
},
},
}
...and the data is automatically fed in to your route components.
// { self: { currentUser: 'Nick' }, child: { self: { items: ['a', 'b'] }, child: { self: { item: { quantity: 100 }}}}}
const LayoutComponent = ({ children, data, dispatch }) => (
<div>
<p>{data.currentUser}</p>
<div>{children}</div>
</div>
);
// { self: { items: ['a', 'b'] }, child: { self: { item: { quantity: 100 }}}}
const ItemsRouteComponent = ({ data }) => <p>{data.items.length}</p>;
// { self: { item: { quantity: 100 }}}
const ItemRouteComponent = ({ data }) => <p>{data.item.quantity}</p>;
Inverse route lifecycle hooks - you tell the framework what to do...
async function asyncEnter(done, { clientRender, serverRender, dispatch, isClient }) => {
clientRender();
const topOfPageData = await fetchTopOfPage();
dispatch(actions.loadTop(topOfPageData));
serverRender();
if (isClient()) {
const bottomOfPageData = await fetchBottomOfPage();
dispatch(actions.loadBottom(bottomOfPageData));
done();
}
};
Plays nicely (hopefully)...
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. Multiple language translations are available at contributor-covenant.org
Special thanks to ryan florence! Initially based on async-props.
FAQs
Scalable reducer management and data fetching for React Router / Redux.
The npm package ground-control receives a total of 3 weekly downloads. As such, ground-control popularity was classified as not popular.
We found that ground-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.