Guest User

Untitled

a guest
Apr 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. const idArray = ["935", "933", "930"];
  2.  
  3. const objectsArray= [
  4. {
  5. name: "Kevin",
  6. color: "red",
  7. id: "935"
  8. },
  9. {
  10. name: "Ana",
  11. color: "white",
  12. id: "815"
  13. },
  14. {
  15. name: "Maria",
  16. color: "silver",
  17. id: "035"
  18. },
  19. {
  20. name: "Victor",
  21. color: "red",
  22. id: "935"
  23. },
  24. {
  25. name: "Vanessa",
  26. color: "red",
  27. id: "933"
  28. },
  29. ]
  30.  
  31. case ConfigurationsActions.DELETE_CONFIGURATION:
  32. if (action.ocids.length === 1) {
  33. return state.filter(configuration =>
  34. configuration.ocid !== action.ocids[0]
  35. );
  36. } else {
  37. const deleteConfigurations: any = () => {
  38. for (let i = 0; i < action.ocids.length; i++) {
  39. return state.filter(configuration =>
  40. configuration.ocid !== action.ocids[i]
  41. );
  42. }
  43. };
  44. return deleteConfigurations;
  45. }
Add Comment
Please, Sign In to add comment