Package Exports
- lambda-actions
- lambda-actions/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambda-actions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme

Installation
$ npm i lambda-actions --saveUsage
/actions.ts
export const sayHello = (payload) => {
return { say: `Hello ${payload.names.join(' and ')}!` };
};
export const sayGoodbye = (payload) => {
return { say: `Goodbye ${payload.name}` };
};/index.ts
import { sayHello, sayGoodbye } from './actions';
export const async handler = (event) => {
// init
const router = new LambdaActions();
// register actions
router.action('say_hello', sayHello);
// RegExp is also ok
router.action(/say_(goodbye|ciao|pokedova)/, sayGoodbye);
// fire an action
return router.fire({
action: event.action,
payload: event.payload,
});
};