
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@antmjs/global-state
Advanced tools
全局 UI 数据缓存解决方案
我所理解的缓存分 4 类,1: 和 UI 无关的临时缓存;2: 和 UI 无关的本地缓存; 3: 和 UI 相关的全局缓存; 4: 和 UI 相关的局部缓存。本仓库解决的就是 3 的问题。 众所周知,这一类的解决方案其实有很多,比如 redux、mobx,重点其实在于我们的项目适不适合这些比较重的解决方案。结合面试者的回答,有都走 redux 的,有请求走 redux 的,有自己约定的。其实都是在找一个临界点,而这个临界点结合业务以及一线小伙伴的理解都会产生不一样的结果,最终 redux 就成了一个黑洞。 我现在更倾向于少用,当然不是不用,而是可枚举的用(你很清楚里面存储了什么东西,和你使用@antmjs/cache 这个库一样,你很清楚你定义了哪些 key),而且由负责人维护,结合 hooks,业务开发者只管取值。可以看看模版
yarn add @antmjs/global-state
import GlobalState from '@antmjs/global-state'
const {
Provider,
useGlobalState,
useGlobalLoading,
useGlobalError,
useUpdate,
useFetchAndUpdate,
} = GlobalState(
{ user: {} },
{
user: async function () {
/** await getUser */
},
},
)
FAQs
全局UI缓存解决方案
We found that @antmjs/global-state 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.