# easymam

> For easy Mamoization

Latest version **15.0.0** (published 2019-10-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install easymam
pnpm add easymam
yarn add easymam
bun add easymam
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 15.0.0 |
| Published | 2019-10-06 |
| First published | 2019-09-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 22.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | contactsammie |
| Keywords | mamoization |

## Links

- npm: https://www.npmjs.com/package/easymam
- Repository: https://github.com/EasyMam/dev
- Homepage: https://github.com/EasyMam/dev#readme
- Issues: https://github.com/EasyMam/dev/issues
- npm.io page: https://npm.io/package/easymam

## Recent versions

- 15.0.0 (latest) — 2019-10-06
- 14.0.1 — 2019-10-06
- 14.0.0 — 2019-10-06
- 13.0.0 — 2019-10-06
- 12.0.0 — 2019-10-05
- 11.0.0 — 2019-09-23
- 10.0.0 — 2019-09-22
- 9.0.0 — 2019-09-22
- 8.0.0 — 2019-09-22
- 7.0.1 — 2019-09-22
- 7.0.0 — 2019-09-22
- 6.0.0 — 2019-09-22
- 5.1.1 — 2019-09-22
- 5.1.0 — 2019-09-22
- 5.0.2 — 2019-09-22
- … 17 more at https://npm.io/package/easymam/versions

## README

EasyMam - For easy strategic Memoization & Throttling

  [![npm version](https://badge.fury.io/js/easymam.svg)](https://badge.fury.io/js/easymam)
 
  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
 
  2. 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

---
_Source: https://npm.io/package/easymam · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
