Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

tiny JS module for finding an object in an array and returning a copy of the array with the object replaced

License

Notifications You must be signed in to change notification settings

moodysalem/find-and-replace-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FYI

You probably want to use this instead.

Build Status npm 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

About

tiny JS module for finding an object in an array and returning a copy of the array with the object replaced

Resources

License

Stars

Watchers

Forks

Packages

No packages published