MCPcopy Create free account
hub / github.com/breck7/scroll / replaceWith

Method replaceWith

external/.scrollLibs.js:17273–17280  ·  view source on GitHub ↗
(blocks)

Source from the content-addressed store, hash-verified

17271 return results
17272 }
17273 replaceWith(blocks) {
17274 const split = splitBlocks(blocks, SUBPARTICLE_MEMBRANE, PARTICLE_MEMBRANE).reverse()
17275 const parent = this.parent
17276 const index = this.index
17277 const newParticles = split.map((block, newBlockIndex) => parent._insertBlock(block, index))
17278 this.destroy()
17279 return newParticles
17280 }
17281 replaceParticle(fn) {
17282 const parent = this.parent
17283 const index = this.index

Callers 4

.scrollLibs.jsFile · 0.80
.datatables.jsFile · 0.80
NFunction · 0.80

Calls 5

destroyMethod · 0.95
splitBlocksFunction · 0.85
reverseMethod · 0.80
mapMethod · 0.80
_insertBlockMethod · 0.80

Tested by

no test coverage detected