Home Reference Source Test Repository

Function

Static Public Summary
public

operation(target: Object, key: string, descriptor: Object): Object

Operation decorator for handler methods.

since 2.0.0

Static Public

public operation(target: Object, key: string, descriptor: Object): Object since 2.0.0 source

import {operation} from 'lambda6/src/index.js'

Operation decorator for handler methods. Decorating a method in a Handler subclass will attach a EndpointMetadata to that method, making it visible as an operation Endpoint.

Params:

NameTypeAttributeDescription
target Object

the target class of the decorator

key string

the key used to access the method being decorated

descriptor Object

the property descriptor of the method

Return:

Object

the modified property descriptor of the method

Example:


import { Handler, operation } from 'lambda6'

class TestHandler extends Handler {

  @operation
  decoratedOperation() { return 'handled'; }

}