/
githubmirror
/
immutable-js
Обзор
Документация
Войти
/
githubmirror
/
immutable-js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
website/docs/mergeDeepWith().mdx
28 строк
747 B
Julien Deniau
Doc as mdx instead of export from .d.ts file (#2104)
24 май 2025, 00:47
Не верифицирован
24 май 2025, 00:47
21de701
Код
Авторство
О чём код?
import Repl from '@/repl/Repl.tsx'; # mergeDeepWith() Like[`mergeDeep()`](<../mergeDeep()>), but when two non-collections or incompatible collections are encountered at the same key, it uses the `merger` function to determine the resulting value. Collections are considered incompatible if they fall into separate categories between keyed, indexed, and set-like. <Signature code={`mergeDeepWith( merger: (oldVal, newVal, key) => any, collection, ...collections )`} /> A functional alternative to `collection.mergeDeepWith()` which will also work with plain Objects and Arrays. <Repl defaultValue={`const original = { x: { y: 123 }} mergeDeepWith( (oldVal, newVal) => oldVal + newVal, original, { x: { y: 456 }} )`} />