15.4.1 • Published 5 years ago
@the-/mixin-controller v15.4.1
@the-/mixin-controller
Mixins for the-controller
Installation
$ npm install @the-/mixin-controller --save
Usage
'use strict'
const { TheCtrl } = require('@the-/controller')
const { withAuthorized } = require('@the-/mixin-controller')
async function tryExample() {
class MyCtrl extends withAuthorized(TheCtrl) {
async doSomething() {
await this._assertAuthorized() // Inherit from withAuthorized
/* ... */
}
}
const ctrl = new MyCtrl()
await ctrl.doSomething()
}
tryExample().catch((err) => console.error(err))
API Guide
- global
See API Guide for more detail
License
This software is released under the MIT License.