1.0.5 • Published 1 year ago

@growsari/idempotency v1.0.5

Weekly downloads
3
License
ISC
Repository
-
Last release
1 year 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.5

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago