diff --git a/src/lock.ts b/src/lock.ts index 404cf13..0f5e075 100644 --- a/src/lock.ts +++ b/src/lock.ts @@ -1,16 +1,15 @@ import Connector from './connector'; export default class Lock { - public connectors = {}; + public connectors: Record = {}; public options = {}; addConnector(connector: any) { - this.connectors[connector.key] = connector.connector; + this.connectors[connector.key] = new connector.connector(connector.options); this.options[connector.key] = connector.options; } getConnector(key: string): Connector { - const options = this.options[key]; - return new this.connectors[key](options); + return this.connectors[key]; } }