Ya no usa lodash

This commit is contained in:
Alejandro Tasistro 2025-05-27 20:42:45 -03:00
parent 4af9e53a50
commit deaa65d857

View file

@ -1,5 +1,3 @@
import { dropWhile } from "lodash/array";
const state = {
show_chismosa: false,
show_devoluciones: false,
@ -24,6 +22,14 @@ const mutations = {
const actions = {
clickMiga({ dispatch }, { miga }) {
let dropWhile = (array, pred) => {
let result = array.slice(0);
while (result.length && pred(result[0])) {
result = result.slice(1)
}
return result;
}
dispatch(miga.action, miga.arguments ?? null, { root: true });
state.migas = dropWhile(state.migas.reverse(),(m => m.nombre !== miga.nombre)).reverse();
},