Skip to content
New issue

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

fix(shared): remove the apply of delayRef to taro.createIntersectionO… #14570

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

TheKonka
Copy link
Member

…bserver

#14563

这个 PR 做了什么? (简要描述所做更改)
删除 代码里对 createIntersectionObserver 方法的替换,因为createIntersectionObserver方法有定义参数
#13972

这个 PR 是什么类型? (至少选择一个)

这个 PR 涉及以下平台:

  • 所有小程序
  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 字节跳动小程序
  • QQ 轻应用
  • 京东小程序
  • 快应用平台(QuickApp)
  • Web 平台(H5)
  • 移动端(React-Native)
  • 鸿蒙(harmony)

@SuJunming
Copy link
Contributor

这个新的啥时候支持啊,我发现升级小版本后也不能用了,我现在只能wx.来用

@ZakaryCode ZakaryCode merged commit e462f76 into NervJS:next Sep 22, 2023
4 checks passed
@TheKonka TheKonka deleted the fix/createIntersectionObserver branch September 22, 2023 03:23
@SuJunming
Copy link
Contributor

想问问这个删除后,taro.createIntersectionObserver可以按照预期执行吗?之前是因为什么,我好看是打补丁还是更新版本呢

@TheKonka
Copy link
Member Author

想问问这个删除后,taro.createIntersectionObserver可以按照预期执行吗?之前是因为什么,我好看是打补丁还是更新版本呢

之前是因为 createIntersectionObserver() 方法的参数都丢失了,所以效果与预期不符,如果不升级版本可以直接用 wx. 来调用

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 22, 2023

@TheKonka 这里感觉不需要把对 createIntersectionObserver 的处理去除?尝试了一下把参数透传是可以的

image

@SuJunming
Copy link
Contributor

想问问这个删除后,taro.createIntersectionObserver可以按照预期执行吗?之前是因为什么,我好看是打补丁还是更新版本呢

之前是因为 createIntersectionObserver() 方法的参数都丢失了,所以效果与预期不符,如果不升级版本可以直接用 wx. 来调用

如果之后升级呢?我现在这边是用wx.调用的,但是alipay还是得用Taro.

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 22, 2023

#14583

@TheKonka
Copy link
Member Author

@TheKonka 这里感觉不需要把对 createIntersectionObserver 的处理去除?尝试了一下把参数透传是可以的

image

大佬,这个方法我是没有想到,试了一下确实是可以的。
PS: 个人角度, argument好像不提倡用了,还有其实不加delayRef 正常也是可以获取到节点的,如果具体场景开发者需要可以自行添加延时之类的,所以感觉加不加都行

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 22, 2023

@TheKonka 这里感觉不需要把对 createIntersectionObserver 的处理去除?尝试了一下把参数透传是可以的
image

大佬,这个方法我是没有想到,试了一下确实是可以的。 PS: 个人角度, argument好像不提倡用了,还有其实不加delayRef 正常也是可以获取到节点的,如果具体场景开发者需要可以自行添加延时之类的,所以感觉加不加都行

...arguments 已改~

这里多次一举地在框架里对这两个 API 做延时是希望有时开发者不写也能正常使用,减少开发者特别是新手的心智负担。因为在不同小程序框架和不同环境下,常常会有一些反馈说需要添加延时才能执行,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createIntersectionObserver options thresholds: [0, 1], 阈值设置为1无效
4 participants