Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
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 2 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.