We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hooks是依赖顺序的,以下代码应该会报错,至于为啥违反了react原则又没报错,这个很有水准
export function useObservableInternal<TOutput, TInputs extends Readonly<any[]>>( useCustomEffect: typeof useEffect, init: | (() => Observable<TOutput>) | ((inputs$: Observable<[...TInputs]>) => Observable<TOutput>), inputs?: [...TInputs] ): Observable<TOutput> { if (!inputs) { return useRefFn(init as () => Observable<TOutput>).current } const inputs$Ref = useRefFn(() => new BehaviorSubject(inputs)) const source$Ref = useRefFn(() => init(inputs$Ref.current)) const firstEffectRef = useRef(true) useCustomEffect(() => { if (firstEffectRef.current) { firstEffectRef.current = false return } inputs$Ref.current.next(inputs) }, inputs) return source$Ref.current }
The text was updated successfully, but these errors were encountered:
https://observable-hooks.js.org/zh-cn/api/#useobservablestate 见文档说明,这是兼容了两个不一样的使用场景,所以不会冲突。但如果让我再设计一遍可能不会这么骚了嘻嘻😁。
Sorry, something went wrong.
No branches or pull requests
hooks是依赖顺序的,以下代码应该会报错,至于为啥违反了react原则又没报错,这个很有水准
The text was updated successfully, but these errors were encountered: