Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ut-dispatch

Easily expose backend methods through script port.

Usage

Implied namespaces:

const dispatch = require('ut-function.dispatch');
module.exports = function({utMethod}) {
    return dispatch({
        'external.identity': utMethod('internal.identity.check'),
        'external.message': utMethod('internal.message.receive')
    })(...arguments);
};

Provide namespace explicitly:

const dispatch = require('ut-function.dispatch');
module.exports = function({utMethod}) {
    return dispatch({
        namespace: 'external',
        methods: {
            'external.identity': utMethod('internal.identity.check'),
            'external.message': utMethod('internal.message.receive')
        }
    })(...arguments);
};