Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@centarius/state-hoc
Advanced tools
state-hoc plugin for centarius.
Centarius State HOC is created to reduce boilerplate in your render function.
Centarius State HOC is using CentariusConsumer
from packages centarius
to get current state from centarius
component.
You can pass options like LoadingComponent
and ErrorComponent
to maximize user experience while fetching data takes lot times.
$ npm install --save-dev @centarius/state-hoc
OR
$ yarn add @centarius/state-hoc
The API is as same as Connect
HOC by React-Redux
TL;DR All static methods will be hoisted
centariusStateHoc: ({ LoadingComponent = null, ErrorComponent = null }) => (Component: React.Component<any, any>) => WrappedComponent: React.Component<any, any>
// Home.js
import React from 'react';
import { NavLink } from 'react-router-dom';
import centariusStateHoc from '@centarius/state-hoc'
class Home extends React.Component {
static async getInitialProps({ req, res, match }) {
const stuff = await CallMyApi();
return { stuff };
}
render() {
return (
<div>
<NavLink to="/about">About</NavLink>
<h1>Home</h1>
<div>{this.props.data.stuff}</div>
</div>
);
}
}
export default centariusStateHoc({
LoadingComponent: () => <div>Loading...</div>,
ErrorComponent: () => <div>Error!</div>
})(Home);
Any issues or questions can be sent to the centarius monorepo.
Please be sure to specify that you are using @centarius/state-hoc
.
MIT © Ray Andrew
FAQs
Centarius State HOC
We found that @centarius/state-hoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.