Skip to content

Instantly share code, notes, and snippets.

View fimion's full-sized avatar
🦄
I'M A UNICORN!!

Alex Riviere fimion

🦄
I'M A UNICORN!!
View GitHub Profile
/**
*
* @param {string} key - the unique key on each object
* @param {Array} arrays - the arrays to be iterated over
* @returns an array of unique objects between all the passed arrays
*/
function getUniqueObjectsFromMultipleArrays(key, ...arrays){
// Make a place to store everything
const objectMapper = new Map();
// filter out anything not an array
@fimion
fimion / server-hot-reload.js
Last active August 18, 2023 20:26 — forked from mikeckennedy/server-hot-reload.js
Server-side hot reload checker by Michael Kennedy. When the contents of the page change in any way, the page will be reloaded.
// *************************************************************************
// Server-side hot reload check by Michael Kennedy (https://mkennedy.codes).
// Released under the MIT open source license, 2023.
//
// Usage: Include this file in your "application shell" layout template
// or directly into any page you'd like to check.
//
// Set the checkIntervalInMs time to the frequency you need. Usually 1 sec
// should be fine, but if a page is slow maybe increase the delay.
//