Skip to content

Commit 2bd51a1

Browse files
Update first.js
Fixing the liniting issue Signed-off-by: Suyash Pathak <[email protected]>
1 parent 39c8178 commit 2bd51a1

File tree

1 file changed

+12
-10
lines changed
  • lib/node_modules/@stdlib/repl/presentation/lib/commands

1 file changed

+12
-10
lines changed

lib/node_modules/@stdlib/repl/presentation/lib/commands/first.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,21 @@ function command( pres ) {
3636
* @private
3737
*/
3838
function onCommand() {
39-
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
40-
41-
/**
42-
* Callback invoked upon a `drain` event.
43-
*
44-
* @private
45-
*/
46-
function onDrain() {
47-
pres.first().show();
48-
}
39+
// bind `pres` so `onDrain` still has access to it:
40+
pres._repl.once( 'drain', () => onDrain( pres ) ); // eslint-disable-line no-underscore-dangle
4941
}
5042
}
5143

44+
/**
45+
* Callback invoked upon a `drain` event.
46+
*
47+
* @private
48+
* @param {Presentation} pres - presentation instance
49+
*/
50+
function onDrain( pres ) {
51+
pres.first().show();
52+
}
53+
5254

5355
// EXPORTS //
5456

0 commit comments

Comments
 (0)