Aijan
@Aijan@programming.dev
This is a remote user, information on this page may be incomplete. View at Source ↗
- Comment on Mocks are the Little-Death: Escaping the Mirage of Green Tests 6 days ago:
You can handle complex branching using standard JavaScript. Since every pipeline is just a function returning data, you can use if/else or map to return different sub-pipelines and commands from within your logic functions. Here’s an example:
const processUsersFlow = () => effectPipe( fetchAllUsers, (users) => { const tasks = users.map(user => { if (user.isAdmin) return syncAdminPermissions(user); // Sub-pipeline if (user.isGuest) return cleanupGuestAccount(user); // Sub-pipeline return notifyUser(user); // Simple Command }); return Parallel(tasks); } )();
- Submitted 6 days ago to programming@programming.dev | 8 comments