Options
All
  • Public
  • Public/Protected
  • All
Menu

super-aop

实现JavaScript aop面向切面编程

Usage

npm i super-aop
import aop from 'super-aop'

let fn = () => {
  console.log('fn')
  return 1
}

fn = aop(fn, {
  before() {
    console.log('before')
  },
  after(fnReturn) {
    console.log('after')
    console.log(fnReturn)
  }
})

// before
// fn
// after
// 1

Index

Interfaces

Type aliases

Functions

Type aliases

Func

Func: function

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

Functions

aop

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc