kliph / sunrise

Procedurally generates sunrises and sunsets
MIT License
0 stars 0 forks source link

Mountains should not re render when window resizes #12

Open kliph opened 6 years ago

kliph commented 6 years ago

@ryanhinkel Thinking about approaches since I'm already like 3 branches deep :a: lmao.

I think we could create some state in sunrise.state to hold the data for rendering the mountains. We could create the mountains once when the page loads, maybe when sunrise.core evaluates, and then render the same data every time.

I think this will require storing the mountain path data (https://github.com/kliph/sunrise/blob/master/src/sunrise/component.cljs#L24-L33) in sunrise.state/mountain-state and rendering https://github.com/kliph/sunrise/blob/master/src/sunrise/component.cljs#L42 from the sunrise.state/mountain-state (or whatever).