From 2463bfa57e11aa67d7662862a1235f459c13b436 Mon Sep 17 00:00:00 2001 From: John Szwaronek Date: Thu, 4 May 2017 11:50:40 -0400 Subject: [PATCH] Added warning to avoid an issue with iff, else, iffElse hooks. - See https://github.com/feathersjs/feathers-hooks-common/issues/140 --- api/hooks-common.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/hooks-common.md b/api/hooks-common.md index d99db16d..02808eda 100755 --- a/api/hooks-common.md +++ b/api/hooks-common.md @@ -229,6 +229,10 @@ They may include other conditional hooks. See also iff, iffElse, when, unless, isNot, isProvider. +> **This** The predicate and hook functions in the if, else and iffElse hooks +will not be called with `this` set to the service. +Use `hook.service` instead. + ## every @@ -299,6 +303,9 @@ They may include other conditional hooks. See also iffElse, else, when, unless, isNot, isProvider. +> **This** The predicate and hook functions in the if, else and iffElse hooks +will not be called with `this` set to the service. +Use `hook.service` instead. ## iffElse @@ -333,6 +340,9 @@ It returns either a boolean or a Promise that evaluates to a boolean See also iff, else, when, unless, isNot, isProvider. +> **This** The predicate and hook functions in the if, else and iffElse hooks +will not be called with `this` set to the service. +Use `hook.service` instead. ## isNot