'use strict'

const createHandler = require('./createHandler.js')

module.exports = class HandlerRunner {
  constructor(funOptions, options) {
    this._handler = createHandler(funOptions, options)
  }

  run(event, context, callback) {
    return this._handler(event, context, callback)
  }
}

'use strict'

const createHandler = require('./createHandler.js')

module.exports = class HandlerRunner {
  constructor(funOptions, options) {
    this._funOptions = funOptions
    this._options = options
  }

  run(event, context, callback) {
    const handler = createHandler(this._funOptions, this._options)

    return handler(event, context, callback)
  }
}

Fix creating new handler for each invocation
Fix creating new handler for each invocation
