
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
@lokibai/react-store
Advanced tools
state management for react
npm install --save @lokibai/react-store
// index.js
import React from 'react';
import { configureStore, Provider } from '@lokibai/react-store';
import App from './app';
const reducer = (state, action = {}) => {
const { type } = action;
switch (type) {
case 'increase':
return { ...state, count: state.count + 1 };
case 'decrease':
return { ...state, count: state.count - 1 };
default:
return state;
}
};
const store = configureStore({reducer, preloadedState: { count: 10 });
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
);
// app.js
import React from 'react';
import { useSelector, useDispatch } from '@lokibai/react-store';
const App = () => {
const count = useSelector(state => state.count);
const dispatch = useDispatch();
const increase = () => {
dispatch({ type: 'increase' });
};
const decrease = () => {
dispatch({ type: 'decrease' });
};
return (
<div>
<span>{count}</span>
<button onClick={increase}>+</button>
<button onClick={decrease}>-</button>
</div>
);
};
export default App;
FAQs
state management for react
We found that @lokibai/react-store 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.