_onResourceRemoved(type, model) {
        debug('_onResourceRemoved', type);

        const resourceId = model._previousAttributes.id;
        const index = this.data[type].findIndex(resource => resource.data.id === resourceId);

        // Resource might not be in cache if e.g. visibility was internal
        if (index === -1) {
            debug('Resource not found in cache', resourceId);
            return;
        }

        // remove the resource from cache
        const [removedResource] = this.data[type].splice(index, 1);
        removedResource.remove();
    }
@description Listener for "model removed" event.
@param {ResourceType} type
@param {import('bookshelf').Model} model
@private