diff --git a/ch3.md b/ch3.md index 83e80383..a1ff16f5 100644 --- a/ch3.md +++ b/ch3.md @@ -215,6 +215,16 @@ var signUp = function(attrs) { welcomeUser(user); }; +var saveUser = function(attrs) { + var user = Db.save(attrs); + ... +}; + +var welcomeUser = function(user) { + Email(user, ...); + ... +}; + //pure var signUp = function(Db, Email, attrs) { return function() { @@ -222,6 +232,14 @@ var signUp = function(Db, Email, attrs) { welcomeUser(Email, user); }; }; + +var saveUser = function(Db, attrs) { + ... +}; + +var welcomeUser = function(Email, user) { + ... +}; ``` The example here demonstrates that the pure function must be honest about its dependencies and, as such, tell us exactly what it's up to. Just from its signature, we know that it will use a `Db`, `Email`, and `attrs` which should be telling to say the least.