const arr = ['a', 'b', 'c'];
const [first, ...rest] = arr;
rest; // ['b', 'c']
// With ignore
const...[first, , ...rest] = arr;
rest; // ['c']
还可收集函数参数为数组。...function directions(first, ...rest) {
console.log(rest);
}
directions('a', 'b', 'c'); // ['b', 'c'...if (status === 'error') {
throw new Error(message);
}
return { data };
}
然后,这类错误就会走到 onError hook...Subscription
subscriptions 是订阅,用于订阅一个数据源,然后根据需要 dispatch 相应的 action。