Skip to content

Conversation

@mattgperry
Copy link
Collaborator

@mattgperry mattgperry commented Nov 27, 2018

viewportscroll

y.set(window.pageYOffset)
}

window.addEventListener("scroll", onScroll, { passive: true })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use the useEvent hook

useEffect(() => {
const onScroll = () => {
x.set(window.pageXOffset)
y.set(window.pageYOffset)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a cross browser value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transformer: interpolate(from, to),
})

const transformer = interpolate(from, to) as Transformer<any>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need casting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to moan, now it doesn't for some reason!

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.

2 participants