Skip to content

Instantly share code, notes, and snippets.

@BenOsodrac
Last active October 18, 2022 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenOsodrac/5a496a5d40d62590dcb5d5a0ca637c87 to your computer and use it in GitHub Desktop.
Save BenOsodrac/5a496a5d40d62590dcb5d5a0ca637c87 to your computer and use it in GitHub Desktop.
Class Template
class MyCompanyDatePicker {
// Public field declarations;
pickerId;
// Private field declarations
#onDateSelectEvent;
constructor(datePickerId, onDateSelectEventHandler){
this.pickerId = datePickerId;
this.#onDateSelectEvent = onDateSelectEventHandler;
// Init custom picker and call mount() method
}
mount() {
// Do the code we need create the custom funcionalities
}
update() {
// Update any dynamic html elements and trigger the OnDateSelected event back to the platform
}
onApply() {
// Mwthod that applies the selected dates
}
onReset() {
// Method that resets the selcted dates
}
destroy() {
// remove any HTML elements and listeners created and destroy the instance
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment