
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
get-set-action
Advanced tools
A React State Management Library similar and alternative to mobx, redux.etc. it's the simplest, smallest and fastest state management library for react with dev tools support.
This library provides a set of utilities for managing actions, async actions, and fetch operations, particularly useful for making AI calls. It is designed to simplify the handling of asynchronous operations and state management in JavaScript applications.
To use this library, simply import the functions you need from the index.ts file.
The action function allows you to create enhanced functions with interceptors and subscription capabilities.
import { action } from './index';
const myAction = action((props) => {
console.log('Action executed with:', props);
return props;
});
myAction.intercept((props) => {
console.log('Intercepted:', props);
return { ...props, intercepted: true };
});
myAction.subscribe((result) => {
console.log('Result:', result);
});
myAction({ key: 'value' });
The asyncAction function is used to manage asynchronous operations with support for debouncing and throttling.
import { asyncAction } from './index';
const myAsyncAction = asyncAction(async (payload) => {
const response = await fetch(payload.url);
return response.json();
}, { debounce: 500 });
myAsyncAction.run({ url: 'https://api.example.com/data' })
.then(data => console.log('Data:', data))
.catch(error => console.error('Error:', error));
The Fetch function simplifies fetch operations with built-in interceptors for request, response, and error handling.
import { Fetch } from './index';
const fetchAction = Fetch({ debounce: 1000 });
fetchAction.run({ url: 'https://api.example.com/data' })
.then(response => console.log('Response:', response))
.catch(error => console.error('Error:', error));
fetchAction.intercept((payload) => {
console.log('Request Intercepted:', payload);
return payload;
});
fetchAction.interceptAfter((data) => {
console.log('Response Intercepted:', data);
return data;
});
fetchAction.interceptError((error) => {
console.error('Error Intercepted:', error);
return error;
});
This library provides a comprehensive set of tools for managing actions and asynchronous operations in your applications. Whether you need to debounce a function, manage async actions, or perform fetch operations with custom interceptors, this library has you covered.
FAQs
A React State Management Library similar and alternative to mobx, redux.etc. it's the simplest, smallest and fastest state management library for react with dev tools support.
We found that get-set-action demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.