How to use the object-path.del function in object-path

To help you get started, we’ve selected a few object-path examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Autodesk / clearx / src / store.js View on Github external
del (key) {
    objectpath.del(this.data, key)
    this.handler.changed([key])
  }
  // tests path existence
github nasa / cumulus-dashboard / app / src / js / reducers / pdrs.js View on Github external
export default function reducer (state = initialState, action) {
  state = Object.assign({}, state);
  const { id, data } = action;
  switch (action.type) {
    case PDR:
      set(state, ['map', id, 'inflight'], false);
      set(state, ['map', id, 'data'], assignDate(data));
      // https://github.com/nasa/cumulus-dashboard/issues/284
      del(state, ['deleted', id]);
      break;
    case PDR_INFLIGHT:
      set(state, ['map', id, 'inflight'], true);
      break;
    case PDR_ERROR:
      set(state, ['map', id, 'inflight'], false);
      set(state, ['map', id, 'error'], action.error);
      break;

    case PDRS:
      set(state, ['list', 'data'], data.results);
      set(state, ['list', 'meta'], assignDate(data.meta));
      set(state, ['list', 'inflight'], false);
      set(state, ['list', 'error'], false);
      break;
    case PDRS_INFLIGHT:
github nasa / cumulus-dashboard / app / src / js / reducers / collections.js View on Github external
export default function reducer (state = initialState, action) {
  state = Object.assign({}, state);
  const { id, data } = action;

  switch (action.type) {
    case COLLECTION:
      const colName = id.split('___');
      const collection = data.results.find(function (element) {
        return element.name === colName[0];
      });
      set(state, ['map', id, 'inflight'], false);
      set(state, ['map', id, 'data'], assignDate(collection));
      del(state, ['deleted', id]);
      break;
    case COLLECTION_INFLIGHT:
      set(state, ['map', id, 'inflight'], true);
      break;
    case COLLECTION_ERROR:
      set(state, ['map', id, 'inflight'], false);
      set(state, ['map', id, 'error'], action.error);
      break;

    case COLLECTION_APPLYWORKFLOW:
      set(state, ['executed', id, 'status'], 'success');
      set(state, ['executed', id, 'error'], null);
      break;
    case COLLECTION_APPLYWORKFLOW_INFLIGHT:
      set(state, ['executed', id, 'status'], 'inflight');
      break;
github Atomic-Reactor / Reactium / .core / sdk / handle / index.js View on Github external
unregister(id = '') {
        const path = Array.isArray(id) ? id : id.split('.');
        op.del(this.handles, path);
        this._update();
    }
github Coonti / Coonti / coonti / config.js View on Github external
this.removeConfigParam = function*(param) {
		if(!!param) {
			objectPath.del(config, param);
			yield this.writeConfigToDb('coontiConfiguration', config);
			yield coonti.fireEvent('Coonti-Config-Changed');
			return true;
		}
		return false;
	};
github luisgustavolf / react-satisfying-forms / dev / src / react-satisfying-forms / form.tsx View on Github external
this.setState((prev) => {
                OPath.del(prev.fieldsValues, fieldName)
                this.removeFieldStatus(prev, fieldName, removeChildStatus)
                return { ...prev }
            }, () => { 
                this.updateFormStatus().then(() => resolve())
github lucasconstantino / apollo-cache-invalidation / src / index.js View on Github external
      ? Object.keys(objectCacheData[ROOT]).forEach(key => del(objectCacheData, [ROOT, key]))
      : del(objectCacheData, path)
github lucasconstantino / apollo-cache-invalidation / src / index.js View on Github external
.forEach(path => path.length === 1 && path[0] === ROOT
      ? Object.keys(objectCacheData[ROOT]).forEach(key => del(objectCacheData, [ROOT, key]))
      : del(objectCacheData, path)
    )
github denouche / virtual-assistant / src / helpers / configuration-service.js View on Github external
static remove(key) {
        debug('remove %s', key)
        var currentConfig = this.get();
        objectPath.del(currentConfig, key);
        fs.writeFileSync(this.getFilename(), JSON.stringify(currentConfig, null, 4));
    }
}
github anthonyshort / deku / lib / render.js View on Github external
function removeAllEvents (entityId) {
    keypath.del(handlers, [entityId])
  }