Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "aa-hooks", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Library for working with autonomous agent events", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -38,3 +38,3 @@ | ||
const regSymbolHandler = (triggerUnit, responseObj) => { | ||
const regSymbolHandler = async (triggerUnit, responseObj) => { | ||
const symbol = triggerUnit.messages.find((m => m.app === 'data'))?.payload?.symbol; | ||
@@ -54,9 +54,9 @@ console.error("Reg new symbol: ", symbol); | ||
// custom hook | ||
// custom filter | ||
hooks.register(regSymbolHandler) | ||
.isSuccess() | ||
.customHook(async (responseObj, meta) => { | ||
.customFilter(async (responseObj, meta) => { | ||
const { payload, trigger_unit } = meta; | ||
// this is a filter function | ||
// always returns boolean value* | ||
// always returns boolean value | ||
}, ["payload", "trigger_unit"]) | ||
@@ -63,0 +63,0 @@ .triggerDataContainsKey("symbol"); |
117727