rxjs library code example

Example 1: angular map

let map = new Map();
map.set() – method to add entries in Map
map.get() – to retrieve an entry from Map
map.has() – to existence of an entry in the Map
map.delete() – deletes an entry from the Map
map.size – ‘size’ property will return size of Map
map.clear()-to clear the Map data

Example 2: rxjs

content_copy
      
      
        open_in_new
      
      let count = 0;
let rate = 1000;
let lastClick = Date.now() - rate;
document.addEventListener('click', () => {
  if (Date.now() - lastClick >= rate) {
    console.log(`Clicked ${++count} times`);
    lastClick = Date.now();
  }
});