13
Je lis an example of the React-dnd project:
moveCard(dragIndex, hoverIndex) {
const { cards } = this.state;
const dragCard = cards[dragIndex];
this.setState(update(this.state, {
cards: {
$splice: [
[dragIndex, 1],
[hoverIndex, 0, dragCard]
]
}
}));}
Est-ce épissure $ le même expliqué on this page?
Quelqu'un pourrait-il expliquer ce que fait ce morceau de code? La fonction $splice
est très confuse pour moi.