mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
11 lines
251 B
TypeScript
11 lines
251 B
TypeScript
export function isMobile() {
|
|
return window.innerWidth < 768
|
|
}
|
|
|
|
export function removeItem<T>(arr: Array<T>, value: T): Array<T> {
|
|
const index = arr.indexOf(value);
|
|
if (index > -1) {
|
|
arr.splice(index, 1);
|
|
}
|
|
return [...arr];
|
|
} |