wuomzfx / hoox Goto Github PK
View Code? Open in Web Editor NEWFunctional react state management base on hooks
License: MIT License
Functional react state management base on hooks
License: MIT License
useMemo(() => {
setHoox = patch => setState(prevState => Object.assign(
{},
prevState,
patch instanceof Function ? patch(prevState) : patch,
));
resetHoox = setState;
}, []);
你好,在阅读源码的时候有个疑惑,就是 Provider 组件的实现中,有这个使用 useMemo 的操作,这里使用 useMemo 的含义是什么呢,希望作者能解答一下。
有一个非常严重的问题:createHoox的返回结果(比如getHoox, useHoox, createContainer)与唯一一个组件实例绑定。
比如const Container = createContainer(Counter)
那么 Container只能用在一个地方!
举个例子,如果在topbar里渲染一次Container,在menu里渲染一次Container。那么当我们调用setHoox的时候,究竟是哪个组件实例的state被修改了?
在公众号看到这个插件,有一个疑问,想请教一下。
如果项目已经使用 typescript,那么是直接引用 src 里的文件吗?
如果项目没有使用 typescript,是引用打包之后的文件吗?
想请教一下,您这边是如何在项目中使用的。
能否做到像 react 一样,生成 *.d.ts,让没有使用 typescript 的项目也可以享用类型提示。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.