https://github.com/betula/use-between
给的例子中,为什么要用useSharedCounter多包装一次useCounter:
useSharedCounter
useCounter
const useSharedCounter = () => useBetween(useCounter);
我试了下,将上面一句省掉,直接用 const { count } = useBetween(useCounter);也能使用啊。
const { count } = useBetween(useCounter);
有什么特殊场合需要那样吗?