Skip to Content

Cached

Similar to memoized, but with an expiration time.

Duration can be specified in milliseconds or using a human-readable string, powered by ms.

import { cached } from 'aspectra/utils'
 
class Database {
  @cached('2h') public queryAll() {
    // sql: SELECT * FROM table
  }
}
Last updated on