MethodHooks

MethodHooks

Source:

Method Hooks for Meteor - Use a hook to run something before or after a method on the server Reused Meteor method hooks from hitchcott/meteor-method-hooks and Workpop/meteor-method-hooks Read more on how to use Method Hooks.

Example

MethodHooks.after('orders/orderCompleted', callback)

Methods

(static) after(methodName, afterFunction) → {String}

Add a function to call after the specified method After hooks can change the result values. Use hooksProcessed to keep track of how many modifications have been made. You can mutate the return value in after hooks.

Source:
Parameters:
Name Type Description
methodName String

methodName

afterFunction String

afterFunction

Returns:
  • returns transformed data, Passed as the methodResult to subsequent method hooks.
Type
String

(static) afterMethods(dict) → {String}

Call the provided hook in values for the key'd method names

Source:
Parameters:
Name Type Description
dict Object

<string, Hook> dict

Returns:
  • returns transformed data, Passed as the methodResult to subsequent method hooks.
Type
String

(static) before(methodName, beforeFunction) → {String}

Add a function to call before the specified method

Source:
Parameters:
Name Type Description
methodName String

methodName

beforeFunction String

beforeFunction

Returns:
  • returns transformed data, Ignored for before hooks
Type
String

(static) beforeMethods(dict) → {String}

Call the provided hook in values for the key'd method names

Source:
Parameters:
Name Type Description
dict Object

<string, Hook> dict

Returns:
  • returns transformed data, Ignored for before hooks
Type
String