15.0.0 • Published 5 years ago

easymam v15.0.0

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

EasyMam - For easy strategic Memoization & Throttling

npm version

A simple Memoization & Throttling Library for use in Web UI & NodeJS environment It allows only one call to be made to your service at any given time and within your set min time

NOTE 1 : IT WILL GO INTO INFINITE LOOP CALL TO YOUR SERVICE IF YOUR SET LOOP CONDITION IS MET

NOTE 2 : IT WILL SEND ONE LAST CALL IF WHILE IN FLIGHT, ANY NEW REQUEST WAS MADE WHOSE RESULT HAD TO BE FETCHED FROM CACHE

NOTE 3: INITIALLY IT WILL RETURN DEFAULT RESULT, SO IF YOU HAVE ONE, SET IT

MORE INFO ==========

Make as much calls as you want to easymam.execute() then it will 1. Call your service if - its the first call ever - or there is no call to the service currently in flight and the last time ago you called is more than your set min wait time

  1. it will return from cache if - there is a current call to our service in flight - or you are still within you set min wait time

               var option = { 
                   minWaitBetweenCalls : 2000 , 
                   onReturnFromCache : function(d){ console.log(d);} 
                   };
    
               var x = await window.easymam("any name for your context")
    
               .execute(async () => {  
    
                 return return "Service response";
    
               },option);
    
               console.info(x);

You can find the sequence test here https://github.com/EasyMam/dev/blob/master/tests.js

And run the sample here https://github.com/EasyMam/dev/blob/master/sample.html

15.0.0

5 years ago

14.0.1

5 years ago

14.0.0

5 years ago

13.0.0

5 years ago

12.0.0

5 years ago

11.0.0

5 years ago

10.0.0

5 years ago

9.0.0

5 years ago

8.0.0

5 years ago

7.0.1

5 years ago

7.0.0

5 years ago

6.0.0

5 years ago

5.1.1

5 years ago

5.1.0

5 years ago

5.0.2

5 years ago

5.0.1

5 years ago

5.0.0

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago