H
H
hackuun2018-07-15 17:03:33
Vue.js
hackuun, 2018-07-15 17:03:33

What do you think about the idea of ​​committing pageYOffset to a state?

For example, I need a value pageYOffsetin several components. The idea came up instead of hanging a handler on the scroll on each component, just store this value in the store and take values ​​from there. What are the consequences? Is it cheaper than doing the same thing in 5 different places?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2018-07-15
@hackuun

It is unlikely to achieve a performance gain. But in terms of code cleanliness, this is a completely normal solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question