Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
fluxxor-components
Advanced tools
Readme
Higher-order components for use with Fluxxor. These are intended to replace FluxMixin and StoreWatchMixin when using ECMAScript 2015 classes.
createContext(flux: Flux): Component
Returns a new component whose elements pass the given Flux instance down
as a context. Every child element of this new component will have
the Flux available as the context prop named flux
.
Intended to replace FluxMixin.
/* Create the flux instance. */
const flux = new Fluxxor.Flux(...);
/* Create the new component with a flux instance as context. */
const FluxContext = createFluxContext(flux);
class App extends React.Component {
/* Declare that we accept the Flux instance from the context. */
static get contextTypes() {
return {
flux: React.PropTypes.object
};
}
render() {
/* Use the flux instance. */
const {flux} = this.context;
const actionNames = Object.keys(flux.actions);
return <ul>{actionNames.map(name =>
<li key={name}>{name}</li>
)}</ul>;
}
}
/* Render the instance: */
React.render(
document.getElementById('react'),
<FluxContext>
<App />
</FluxContext>
);
watchStores(Component, ...StoreNames: String, onChange: (Flux) => Object): Component
Watches the given stores, and passes the updates state as props to the given component. Use the returned component as if it was the given component; except it watches Fluxxor stores.
That is, it returns a component that wraps the given React component and
calls onChange
when any of the given stores are changed. The return of
onChange
is used to update the state; all of this state is
subsequently passed to the wrapped component as props, along with its
original props. Assumes flux
exists in the context (i.e., in the
manner that createFluxContext()
would provide it) or the Flux instance
passed as a prop named flux
.
Intended to replace StoreWatchMixin.
/* We're bringin' it back! */
class Blink extends React.Component {
render() {
const {children, speed} = this.props;
const styles = {
animation: `blink ${speed} steps(2, start) infinite`
};
return <div style={styles}>{children}</div>;
}
}
/* Get the data from the Twitter store. */
const BlinkFromTwitter = watchStores(Blink, 'twitter', (flux) => ({
children: flux.store('twitter').getLatestTweet()
}));
/* Render the instance: */
React.render(
document.getElementById('react'),
<FluxContext>
<BlinkFromTwitter speed="250ms" />
</FluxContext>
);
FAQs
Higher-order components for Fluxxor
The npm package fluxxor-components receives a total of 1 weekly downloads. As such, fluxxor-components popularity was classified as not popular.
We found that fluxxor-components 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.