똑똑한 카운터
An interesting element on interfaces which involve dynamically updating numbers is a smart counter, or odometer effect. Instead of jumping a number up and down, quickly counting to the desired number can achieve a cool effect. An example of a popular library that accomplishes this is odometer by Hubspot. Let's see how we can accomplish something similar with just a few lines of RxJS.
Vanilla JS
( StackBlitz )
HTML
We can easily take our vanilla smart counter and wrap it in any popular component based UI library. Below is an example of an Angular smart counter component which takes an Input of the updated end ranges and performs the appropriate transition.
Angular Version
( StackBlitz )
HTML
Operators Used
Last updated