1.0.0 • Published 4 years ago

@nikositech/subscriptions-handler v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

@nikositech/subscriptions-handler

  • configure(redisConfig, types = [])

  • updateLimit(ref, type, value)

  • updateUsage(ref, type, value)

  • getUsage(ref, type)

  • getLimit(ref, type)

  • deleteSubscription(ref)

  • getAll(ref)

  • checkValue(ref, type) : returns LIMIT >= USAGE

  • canAddValue(ref, type) : returns USAGE > LIMIT
  • getByType(ref, type) : returns {limit, usage} of a type
  • incrementUsage(ref, type) : +1 of USAGE
  • decrementUsage(ref, type)