1.0.4 • Published 2 months ago

@growsari/idempotency v1.0.4

Weekly downloads
3
License
ISC
Repository
-
Last release
2 months ago

Idempotency Package

Sometimes, we have functions that, when executed repeatedly, produce unwanted results. To get around that, use this. It saves a response for 10 mins and prevents any duplicate calls made while executing the function.

Usage

Easiest way to use this is through the function makeIdempotent, wrapping your microservice controller function.

const { makeIdempotent } = require('@growsari/idempotency')

// ...

async function someController(params) {
  // ...
}

// ...

module.exports = {
  someController: makeIdempotent(testTimeout)
}

If you want to use your own logic in reading from the db, get the functions reserve and save, just take inspiration from how makeIdempotent is implemented. lol

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago

1.0.4

2 months ago

1.0.3

2 months ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

4 years ago

0.0.1

4 years ago