MCPcopy
hub / github.com/winjs/winjs / insert

Function insert

tests/TestLib/TestDataSource.ts:142–152  ·  view source on GitHub ↗
(complete, error, index, data)

Source from the content-addressed store, hash-verified

140 }
141
142 function insert(complete, error, index, data) {
143 if (controller.communicationFailure) {
144 error(new WinJS.ErrorFromName(UI.EditError.noResponse.toString()));
145 } else {
146 var itemNew = item(nextAvailableKey++, data);
147 array.splice(index, 0, itemNew);
148 updateKeyToIndexMap(index);
149
150 complete(itemNew);
151 }
152 }
153
154 function change(complete, error, key, dataNew) {
155 if (controller.communicationFailure) {

Callers 1

createTestDataAdapterFunction · 0.85

Calls 6

errorFunction · 0.85
updateKeyToIndexMapFunction · 0.85
itemFunction · 0.70
toStringMethod · 0.65
spliceMethod · 0.65
completeFunction · 0.50

Tested by

no test coverage detected