Teach ramda
✓ Published0🌍 Public
66ewis
Last edited Mar 18, 2016
Created on Mar 18, 2016
This example contrasts two refactorings of the same state-update logic in JavaScript, both using the Ramda library to remove an attribute from a matching object in an array. The first script composes functions like `findIndex`, `propEq`, and `adjust` to locate an object by ID and apply `dissocPath` to delete a nested field. The second script uses `R.when` with `R.propEq` and `R.dissoc` to achieve the same result, then verifies equality with `R.equals`. The code shows how Ramda’s declarative helpers replace manual `map` and `slice` iterations for immutable updates.
AI-generated description