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.
A small, simple, and type-safe state management solution for React and React Native.
Igris is a small, simple, and type-safe state management solution for React and React Native. It offers efficient data persistence and seamless integration with various storage mechanisms. Designed to be lightweight and intuitive, Igris helps developers manage application state with ease and confidence.
You can install Igris via npm or yarn:
npm install igris
or
yarn add igris
import React from 'react';
import { useAStore, createStore } from 'igris';
// Create a new instance of the store with initial state and actions
const counterStore = createStore(
{ count: 0 }, // Initial state
(setState, getState) => ({
// Callback function to generate actions
increment: () => setState({ count: getState().count + 1 }), // Action to increment count
decrement: () => setState({ count: getState().count - 1 }), // Action to decrement count
})
);
//without selector
const CounterComponent = () => {
const { count, decrement, increment } = useAStore(counterStore);
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
);
};
//with selector get state
const CountDisplayComponent = () => {
const count = useAStore(counterStore, (state) => state.count);
return (
<div>
<p>Count: {count}</p>
</div>
);
};
//with selector get actions
const CountActionsComponent = () => {
const increment = useAStore(counterStore, (state) => state.increment);
const decrement = useAStore(counterStore, (state) => state.decrement);
return (
<div>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
);
};
For detailed documentation and usage examples, please visit the Igris GitHub repository.
We welcome contributions from the community! If you encounter any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request on the Igris GitHub repository.
Please consider donating if you think HTTPtestify is helpful to you or that my work is valuable. I am happy if you can help me buy a cup of coffee. ❤️
FAQs
A lightweight, type-safe state management solution designed to make React state simple
The npm package igris receives a total of 7 weekly downloads. As such, igris popularity was classified as not popular.
We found that igris demonstrated a healthy version release cadence and project activity because the last version was released less than 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.