砖家

Results 134 comments of 砖家

```js setUrlState({ page:1, orderBy:'desc' }) ``` 可以满足你的诉求吗?

> > 暂时合并成同一个 useUrlState 用,然后我优化下代码~ > > 同样遇到了这个问题,我在父组件和子组件都用了useUrlState,同时在两个组件中的useEffect中都调用了setUrlState,这样父组件中的setUrlState就会把子组件的覆盖掉,我理解和这个issues应该是同样的问题,目前有什么好的解决方法吗? 暂时还没有好的解决办法。

你可以不用全局配置,改为基于 useRequest 封装一个 Hooks。

自己封装一个 Hooks 可以解决你的问题吧? ```js const useNewReqeust = (service, options)=>{ return useRequest(service, { formatResult: (r)=> r, ...options, }) } ```

useInfiniteScroll 的 `target` 应该是固定高度的。 在你的代码中,`document` 和 `document.body` 的高度都不是固定的,都是会被无限撑起来。

Current changes do not solve all problems, like this: https://stackoverflow.com/questions/35865481/storage-event-not-firing

![image](https://user-images.githubusercontent.com/12526493/91372971-be39c300-e847-11ea-93db-37b83f99a7f7.png) 你的例子是有的呀?

目前行为确实如你所说,等待上一次轮询结束,才会使用新的轮询时间。 最好的行为确实应该是停止当前轮询,用新的时间重新开始。

> 有人看PR吗 。。。 有的,这个暂时不能合并。 现在版本的 debounce 模式的 return 其实是有问题的,正常应该返回 promise。 下个大版本这块彻底重构了:https://github.com/alibaba/hooks/blob/next/packages/hooks/src/useRequest/src/plugins/useDebouncePlugin.ts