pure-effect 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,13 +28,13 @@ const validateRegistration = (input) => {
|
|
|
28
28
|
const findUser = (email) => {
|
|
29
29
|
const cmdFindUser = () => db.findUser(email); // The work to do later
|
|
30
30
|
const next = (user) => Success(user); // Wrap result in Success
|
|
31
|
-
return Command(
|
|
31
|
+
return Command(cmdFindUser, next);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const saveUser = (input) => {
|
|
35
35
|
const cmdSaveUser = () => db.saveUser(input);
|
|
36
36
|
const next = (saved) => Success(saved);
|
|
37
|
-
return Command(
|
|
37
|
+
return Command(cmdSaveUser, next);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
const ensureEmailAvailable = (user) => {
|
|
@@ -52,8 +52,6 @@ const registerUserFlow = (input) =>
|
|
|
52
52
|
|
|
53
53
|
// The Imperative Shell
|
|
54
54
|
async function registerUser() {
|
|
55
|
-
const input = { email: 'new@test.com', password: 'password123' };
|
|
56
|
-
|
|
57
55
|
// logic is just a data structure until we pass it to runEffect
|
|
58
56
|
const logic = registerUserFlow(input);
|
|
59
57
|
|