¿Qué es "..." (3 puntos) en javascript?
Aprendí sobre esto deesta publicación.
function StoreMixin(...stores) { // what is "..."
var Mixin = {
getInitialState() {
return this.getStateFromStores(this.props);
},
componentDidMount() {
stores.forEach(store =>
store.addChangeListener(this.handleStoresChanged)
);
this.setState(this.getStateFromStores(this.props));
},
componentWillUnmount() {
stores.forEach(store =>
store.removeChangeListener(this.handleStoresChanged)
);
},
handleStoresChanged() {
if (this.isMounted()) {
this.setState(this.getStateFromStores(this.props));
}
}
};
return Mixin;
}
Por favor, explique qué es "...", con un código de ejemplo. ¡Gracias!