Last active
April 15, 2024 07:37
-
-
Save Kcko/21b9484fa3c78731ccfec242dbbb9c8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS | |
function setPreferences({ theme = 'dark', layout = 'grid' } = {}) { | |
console.log(`Preferences set: Theme - ${theme}, Layout - ${layout}`); | |
} | |
export function useRefHistory(ref, options) { | |
const { | |
deep = false, | |
capacity = Infinity, | |
} = options; | |
// ... | |
}; | |
// https://michaelnthiessen.com/tips/options-object | |
export function useRefHistory(ref, options) { | |
const { | |
deep = false, | |
capacity = Infinity, | |
...otherOptions, | |
} = options; | |
// Pass along some options we're not using directly | |
useSomeOtherComposable(otherOptions); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment