
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Minimalist state management tools only for React.js
import React from 'react';
import Store, { useStore } from 'back-store';
const Root = () => {
return (
<Store value={{ page1: { count: 1 }, page2: { a: { b: 'hello' } } }}>
<App />
</Store>
);
};
const App = () => {
const [store, setStore] = useStore('page1'); // getting Store state from store
const { count } = store;
const plusOne = () => setStore({ count: count + 1 }); // just like setState
const plusTen = () => setStore(store => ({ count: count + 10 })); // support function
const minusOne = () => setStore('count', count - 1); // lodash.set like syntax for possible deep structure setStore('a.b.c', xx)
return (
<div>
<div>{count}</div>
<button onClick={plusOne}>+</button>
<button onClick={plusOne}>+10</button>
<button onClick={minusOne}>-</button>
</div>
);
};
export default Root;
添加函数式调用
FAQs
Minimalist state management tools only for React.js
The npm package back-store receives a total of 1 weekly downloads. As such, back-store popularity was classified as not popular.
We found that back-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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.