functions service

Adds ability to run custom logic as defined in a blueprint. This service is provided via the tymly plugin and isn't offered by any of the other core plugins.

Boot config

  • This service doesn’t require any configuration to boot.

Blueprint dirs

This service can load resources defined in the following Blueprint directories:

Directory Content
/functions Blueprints are predominantly declarative - preferring JSON definitions over hand-coded functions. But for those times when only code will do, blueprints can supply supplemental Javascript functions too.

Service methods/properties

getFunction

Returns a function that’s been supplied via a blueprint

Parameters

  • namespace string The namespace of the blueprint contributing the function that’s required
  • functionName string And the name of the function, in the specified namespace, that’s required

Examples

var func = functions.getFunction('myCompany', 'magicFormula')

Returns Function A Javascript function as supplied via blueprint

getFunctionParameters

Returns an array of argument names from any specified function

Parameters

Examples

var argList = functions.getFunctionParameters(function (a,b,c){})
console.log(argList) // ['a','b','c']

Returns Array<string> A list of argument names


Boots before

statebox