You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, the constructor of the class can call the start function
but this allows things like setting prompt.color to false to only effect one instance
example
Prompt = require('prompt');
prompt = new Prompt; // Prompt.start() is called doing the constructor, so it doesn't need to be called.
prompt.get(['stuff'], function (err, result){});
// And maybe for backward compatibility purposes, make this possible also.
Prompt.start() // This does need to be called since we're not making an instance.
Prompt.get(['stuff'], function(err, result){});
The idea is to eliminate the need to call
prompt.start()
.In a closure containing prompt.start and prompt.get:
var started = false;
in prompt.start:
started = true;
in prompt.get:
if (!started) prompt.start();
This could be implemented directly with extendFunction:
The text was updated successfully, but these errors were encountered: