Skip to content

Commit

Permalink
fix: watch files callback missing correct this context
Browse files Browse the repository at this point in the history
After the refactor, I broke this by removing the bind in the hooks.
Adding the bind to the callback function retains the this context while
keeping the modularity of the hooks property.

Fixes #162
  • Loading branch information
JackCuthbert committed Jul 15, 2019
1 parent c99fe30 commit ea9d96c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class TypeScriptPlugin {
this.serverless.cli.log(`Watching typescript files...`)

this.isWatching = true
watchFiles(this.rootFileNames, this.originalServicePath, this.compileTs)
watchFiles(this.rootFileNames, this.originalServicePath, this.compileTs.bind(this))
}

async compileTs(): Promise<string[]> {
Expand Down

0 comments on commit ea9d96c

Please sign in to comment.