obj/src/persistence/IdentifiableMemoryPersistence.js
/**
     * Deleted a data item by it's unique id.
     *
     * @param correlationId    (optional) transaction id to trace execution through call chain.
     * @param id                an id of the item to be deleted
     * @returns                 the deleted data item.
     */
Deleted a data item by it's unique id.
@param correlationId    (optional) transaction id to trace execution through call chain.
@param id                an id of the item to be deleted
@returns                 the deleted data item.
Deleted a data item by it ' s unique id . @param correlationId ( optional ) transaction id to trace execution through call chain . @param id an id of the item to be deleted @returns the deleted data item .
deleteById(correlationId, id) {
        return __awaiter(this, void 0, void 0, function* () {
            let index = this._items.map(item => item.id).indexOf(id);
            let item = this._items[index];
            if (index < 0) {
                this._logger.trace(correlationId, "Item %s was not found", id);
                return null;
            }
            this._items.splice(index, 1);
            this._logger.trace(correlationId, "Deleted item by %s", id);
            yield this.save(correlationId);
            return item;
        });
    }
deleteById ( correlationId , id ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { let index = this . _items . map ( item => item . id ) . indexOf ( id ) ; let item = this . _items [ index ] ; if ( index < 0 ) { this . _logger . trace ( correlationId , "Item %s was not found" , id ) ; return null ; } this . _items . splice ( index , 1 ) ; this . _logger . trace ( correlationId , "Deleted item by %s" , id ) ; yield this . save ( correlationId ) ; return item ; } ) ; }
Deleted a data item by it's unique id.
Deleted a data item by it ' s unique id .