find-and-replace-array
v1.0.1
Published
tiny module for finding an object in an array and returning a copy of the array with the object replaced
Downloads
12
Maintainers
Readme
find-and-replace-array
Small plain JavaScript function for finding an object in an array and returning a copy of the array with the matching items replaced.
Used in React components for updating individual items in immutable arrays
Function Signature
findAndReplace(Array array, Object object, Function/string matcher);
Examples
See the test.js file for example usages