We should take the opportunity of the incoming v2 to adopt a thisless api.
This will make action handler far more easy to test without having to mock a vorpal instance.
The function would be injected with a single arguments, an object holding the args, the options, the logger and the callback.
Proposition
We should take the opportunity of the incoming v2 to adopt a
this
less api.This will make action handler far more easy to test without having to mock a vorpal instance. The function would be injected with a single arguments, an object holding the
args
, theoptions
, the logger and the callback.Example
Original Code
V2 proposed code
alternative usage with destructuring: