-
Notifications
You must be signed in to change notification settings - Fork 20
1.0.5 #37
base: master
Are you sure you want to change the base?
1.0.5 #37
Conversation
Signed-off-by: Luozhou (Siyuan Cao) <[email protected]>
Signed-off-by: Luozhou (Siyuan Cao) <[email protected]>
Signed-off-by: Luozhou (Siyuan Cao) <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page 和 App 也同步改一下?
*/ | ||
observe( | ||
targetSelector: string, | ||
callback: (res: IObserveResult) => any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
返回值要不用 void?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有的时候就用箭头函数的,感觉用 void 会限制这个地方?
my.createIntersectionObserver()
.relativeToViewport()
.observe('.className', node => this.nodes.push(node)) // <- 用 void 会报错
types/component.d.ts
Outdated
@@ -69,31 +69,32 @@ declare namespace tinyapp { | |||
$spliceData: SpliceDataMethod; | |||
} | |||
|
|||
type ComponentOptions< | |||
interface InternalComponentOptions<P, D, M> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IInternalComponentOptions
Signed-off-by: Luozhou (Siyuan Cao) <[email protected]>
Signed-off-by: Luozhou (Siyuan Cao) <[email protected]>
* @file IntersectionObserver 对象,用于推断某些节点是否可以被用户看见、有多大比例可以被用户看见。 | ||
*/ | ||
declare namespace my { | ||
namespace intersectionObserver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要加这个 namespace 吧
selectAll?: boolean; | ||
} | ||
|
||
interface IRect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRect -> IIntersectionObserverRect
主要变更
my.createIntersectionObserver
及相关类型的声明。Refactor
ComponentOptions
重构为 interface 以便业务自行扩展。