I am consuming an API in which I register a callback that occurs frequently.
function myCallback(event) {
// do things with event, something computationally intensive
}
const something = createSomething({
onSomethingHappened: myCallback
})
I'd like to limit the rate at which this callback fires, probably using throttle. This project uses Angular which bundles rx. How can I adapt my code so myCallback it throttled at 300ms using rx?
I have a basic grasp on how observables work but it's been a bit confusing to figure out how the callback interface would convert to observable interface.
(edited as answers come)