function removeReminder(state, notificationId) { let reminder = find( state.reminders, reminder => reminder.notificationId === notificationId ); return { ...state, reminders: without(state.reminders, reminder), }; }
function excludeInterface(name, content) { var without = _.curry(function (name, content) { return !_.includes(content, name); }); return _.chain(content) .split('\n\n') .filter(without(name)) .join('\n\n').trim(); }
deleteOrder(order) { let tempOrders = this.state.customerOrders; tempOrders = without(tempOrders, order); this.setState({ customerOrders: tempOrders }); }
const title = this.props.shouldDisplayPoliciesHint ? 'hint' : 'title'; const value = get(this.props.values, this.props.inputSelectName); const path = without(this.props.inputSelectName.split('.'), 'permissions', 'controllers', 'policy'); const controllerRoutes = get(this.props.routes, without(this.props.inputSelectName.split('.'), 'permissions', 'controllers', 'policy')[0]); const routes = isEmpty(controllerRoutes) ? [] : controllerRoutes.filter(o => toLower(o.handler) === toLower(takeRight(path, 2).join('.')));
deleteAppointment(apt) { let tempApts = this.state.myAppointment; tempApts = without(tempApts, apt); // we are using loadash library, with has a method (without). it allows us to delete one record and returns record without 'this' appointment this.setState({ myAppointment: tempApts }); }