MCPcopy
hub / github.com/visgl/deck.gl / clone

Method clone

modules/core/src/lifecycle/component.ts:45–63  ·  view source on GitHub ↗
(newProps: Partial<PropsT>)

Source from the content-addressed store, hash-verified

43
44 // clone this layer with modified props
45 clone(newProps: Partial<PropsT>) {
46 const {props} = this;
47
48 // Async props cannot be copied with Object.assign, copy them separately
49 const asyncProps: Partial<PropsT> = {};
50
51 // See async props definition in create-props.js
52 for (const key in props[ASYNC_DEFAULTS_SYMBOL]) {
53 if (key in props[ASYNC_RESOLVED_SYMBOL]) {
54 asyncProps[key] = props[ASYNC_RESOLVED_SYMBOL][key];
55 } else if (key in props[ASYNC_ORIGINAL_SYMBOL]) {
56 asyncProps[key] = props[ASYNC_ORIGINAL_SYMBOL][key];
57 }
58 }
59
60 // Some custom layer implementation may not support multiple arguments in the constructor
61 // @ts-ignore
62 return new this.constructor({...props, ...asyncProps, ...newProps});
63 }
64}

Callers 15

processDataBufferFunction · 0.80
runLayerTestUpdateFunction · 0.80
createShadowUniformsFunction · 0.80
constructorMethod · 0.80
updateMethod · 0.80
getOSMTileIndicesFunction · 0.80
renderLayersMethod · 0.80
evaluateViewLayoutFunction · 0.80
drawMethod · 0.80
renderSubLayersMethod · 0.80
renderLayersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected