Skip to content

Instantly share code, notes, and snippets.

@cabreraalex
Created June 25, 2021 16:44
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 cabreraalex/d63a6ecbc797d8d2aeaf3aec9846fe0c to your computer and use it in GitHub Desktop.
Save cabreraalex/d63a6ecbc797d8d2aeaf3aec9846fe0c to your computer and use it in GitHub Desktop.
widget-svelte-stores
// Declare stores with their associated Traitlets here.
export const value = WidgetWritable<string>('value', '');
export const count = WidgetWritable<number>('count', 0);
// Set the model for each store you create.
export function setStoreModels(model: DOMWidgetModel): void {
value.setModel(model);
count.setModel(model);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment