Skip to content

Commit

Permalink
Correct subscription method (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
user3587412 authored and SBoudrias committed Jan 20, 2018
1 parent 600bbf8 commit bd79918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prompts/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EditorPrompt extends Base {

// Open Editor on "line" (Enter Key)
var events = observe(this.rl);
this.lineSubscription = events.line.forEach(this.startExternalEditor.bind(this));
this.lineSubscription = events.line.subscribe(this.startExternalEditor.bind(this));

// Trigger Validation when editor closes
var validation = this.handleSubmitEvents(this.editorResult);
Expand Down Expand Up @@ -83,7 +83,7 @@ class EditorPrompt extends Base {

onEnd(state) {
this.editorResult.unsubscribe();
this.lineSubscription.dispose();
this.lineSubscription.unsubscribe();
this.answer = state.value;
this.status = 'answered';
// Re-render prompt
Expand Down

0 comments on commit bd79918

Please sign in to comment.