Open tunnckoCore opened 7 years ago
~~Need updates to minibase-is-registered
and dush-promise
plugins.
And probably update minibase-create-plugin
~~
.use('foobar', pluginFn)
or .use(function foobar () {})
.use((app) => {})
options.Promise
is passed or if ANY promise is detected in depserror
event and also can app.catch()
errors.use
, .on
, .off
, .once
and .emit
methods through dush
.isRegistered
through minibase-is-registered
.then
, .catch
, .resolve
and .reject
through dush-promise
.define
and .delegate
methods through dush-methods
from minibase-is-registered
/*!
* minibase <https://github.com/tunnckoCore/minibase>
*
* Copyright (c) Charlike Mike Reagent <@tunnckoCore> (https://i.am.charlike.online)
* Released under the MIT license.
*/
'use strict'
var dush = require('dush')
var extend = require('extend-shallow')
var betterUse = require('dush-better-use')
// from `dush`:
// .on
// .off
// .once
// .emit
// .use
//
// from `dush-better-use` (overrides the default `dush` .use):
// .use
//
// from `minibase-is-registered`:
// .isRegistered
//
// from `dush-methods` (registered at `minibase-is-registered`):
// .define
// .delegate
//
function MiniBase (options) {
return dush()
.use(function optionsPlugin (app) {
app.options = extend({}, options)
return app
})
.use(betterUse())
}
module.exports = MiniBase
Make it not rely on
this
and use the dush as core event emitter