Fix issue with ThrottleManager so that module exports a constructed object similar to other core Adonis managers.
Installing masasron/adonis-throttle@2.3.2 with README install instructions results with the following error when starting
the application:
With InvalidArgumentException: E_INVALID_IOC_MANAGER: Make sure Adonis/Addons/Throttle does have a extend method.
This is because the this.app.manager in ThrottleProviderregister() expects a function (i.e. a constructed class instance)
This was already done in the following this.app.bind call.
This commit ensures the calls to this.app.manager and this.app.bind are the same functions by exporting new ThrottleManager() in
Manager.js.
ThrottleManagerTest.js also adapted to inject the constructed manager function from Manager.js.
Fix issue with
ThrottleManager
so that module exports a constructed object similar to other core Adonis managers.This is because the
this.app.manager
inThrottleProvider
register()
expects a function (i.e. a constructed class instance) This was already done in the followingthis.app.bind
call.This commit ensures the calls to
this.app.manager
andthis.app.bind
are the same functions by exportingnew ThrottleManager()
inManager.js
.ThrottleManagerTest.js
also adapted to inject the constructed manager function fromManager.js
.