Skip to content

Commit 832abdc

Browse files
committed
Update the displayed presentation upon changes
1 parent 8adf8d4 commit 832abdc

File tree

2 files changed

+11
-0
lines changed
  • lib/node_modules/@stdlib/repl/presentation

2 files changed

+11
-0
lines changed

lib/node_modules/@stdlib/repl/presentation/bin/cli

+10
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,18 @@ function main() {
134134

135135
// Check whether to begin watching the source presentation file...
136136
if ( flags.watch ) {
137+
pres.on( 'change', onChange );
137138
pres.watch();
138139
}
140+
141+
/**
142+
* Callback invoked upon a change to the source presentation file.
143+
*
144+
* @private
145+
*/
146+
function onChange() {
147+
pres.show();
148+
}
139149
}
140150

141151
main();

lib/node_modules/@stdlib/repl/presentation/lib/main.js

+1
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ setNonEnumerableReadOnly( Presentation.prototype, 'watch', function watch() {
11411141
// Case: event === 'change'
11421142
debug( 'Detected a change to the source presentation file.' );
11431143
self.reload();
1144+
self.emit( 'change' );
11441145
}
11451146

11461147
/**

0 commit comments

Comments
 (0)