Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const retryDelay = n => {
switch (mode.value) {
case "delay":
return delay.value;
case "backoff":
return exponentialDelay(n);
}
};
setup() {
const array = new Array(1000).fill(0).map((_, i) => i);
const { result, next, prev, currentPage, lastPage } = useArrayPagination(
array,
{
pageSize: 3
}
);
return { result, next, prev, currentPage, lastPage };
}
};
setup(_){
const elref = ref(null);
const state = reactive({
x: 0,
y: 0
})
const remove = useEvent(elref, 'mousemove', e=> {
state.x = e.x;
state.y = e.y;
})
return {
elref,
remove,
state
}
}
}
setup() {
const key = "__vue_localStorage_example";
const { storage } = useLocalStorage(key, 1);
return {
key,
storage
};
}
};
setup(_) {
const elref = ref(null);
const { mouseX, mouseY, remove } = useOnMouseMove(elref);
return {
elref,
remove,
mouseX,
mouseY
};
}
};
setup(_) {
const { height, width, remove } = useOnResize(document.body);
return {
height,
width,
remove
};
}
};
setup(_) {
const elref = ref(null);
const { scrollTop, scrollLeft, remove } = useOnScroll(elref);
return {
elref,
scrollTop,
scrollLeft,
remove
};
}
};
setup() {
const { isOpen, isClosed, data, errored, send, close } = useWebSocket(
"wss://javascript.info/article/websocket/demo/hello"
);
return {
isOpen,
isClosed,
data,
errored,
send,
close
};
}
};