angel_framework.hooks library

Easy helper hooks.

Functions

addCreatedAt({dynamic assign(dynamic obj, dynamic now), String key, bool serialize: true }) HookedServiceEventListener
Serializes the current time to e.data or e.result. You can provide an assign function to set the property on your object, and skip reflection. If serialize is true (default), then the set date will be a String. If not, a raw DateTime will be used. [...]
addUpdatedAt({dynamic assign(dynamic obj, dynamic now), String key, bool serialize: true }) HookedServiceEventListener
Serializes the current time to e.data or e.result. You can provide an assign function to set the property on your object, and skip reflection. If serialize is true (default), then the set date will be a String. If not, a raw DateTime will be used. [...]
chainListeners(Iterable<HookedServiceEventListener> listeners) HookedServiceEventListener
Sequentially runs a set of listeners.
disable([dynamic provider ]) HookedServiceEventListener
Disables a service method for client access from a provider. [...]
hookAllServices(dynamic callback(Service service)) AngelConfigurer
Runs a callback on every service, and listens for future services to run it again.
remove(dynamic key, [ dynamic remover(dynamic key, dynamic obj) ]) HookedServiceEventListener
Removes one or more keys from e.data or e.result. Works on single objects and iterables. [...]
toJson([dynamic condition ]) HookedServiceEventListener
Transforms e.data or e.result into JSON-friendly data, i.e. a Map. Runs on Iterables as well. [...]
toType(Type type) HookedServiceEventListener
Transforms e.data or e.result into an instance of the given type, if it is not already.
transform(dynamic transformer(dynamic obj), [ dynamic condition ]) HookedServiceEventListener
Mutates e.data or e.result using the given transformer. [...]