Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
587 B

module.exports = Hook
var register = require('./lib/register')
var addHook = require('./lib/add')
var removeHook = require('./lib/remove')
function Hook () {
var state = {
registry: {}
}
var hook = register.bind(null, state)
hook.api = { remove: removeHook.bind(null, state, null) }
hook.remove = removeHook.bind(null, state, null)
;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
hook[kind] = hook.api[kind] = addHook.bind(null, state, kind)
hook.remove[kind] = hook.api.remove[kind] = removeHook.bind(null, state, kind)
})
return hook
}