Hacker News new | ask | show | jobs
by markc 4043 days ago
Very cool!

Nice UI touches too, e.g. maintaining js/history and show/hide editors. I notice the app state is captured in the URL which lets you save a favorite shape. Neat.

What does the throttling do? And what happens without it?

I'd enjoy reading someday about how you developed this (w/ annotated source) and your experiences using core.async, Om, figwheel, etc.

Thanks for sharing it!

1 comments

Yeah, so the application state is captured in the URL with throttling. The behavior isn't too different from Underscore/Lodash's throttle function (https://lodash.com/docs#throttle). Basically, you can click and drag the range sliders to update the visualization pretty rapidly. If I updated the URL with windows.history.pushState every time the state changed for a single keyframe, it would overload the history and be a pain to hit the "back" button. So instead, I throttle calls to pushState so it fires no more than every 500ms.

I think it might be too to do a write-up. I definitely learned a lot doing it!