---
to: widget.ts
---
// This file includes your widget logic
// Learn about the widget.ts file: https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/blocks-site-widgets/widget-ts
// Learn about the Wix CLI and Blocks: https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/code-in-blocks/about-the-blocks-cli-integration

import { defineWidget } from '@wix/blocks';

export default defineWidget('<%- id -%>', ($w, $widget) => {
  $w.onReady(() => {
    // Initialize your widget here. If your widget has properties, this is a good place to read their values.
    console.log('Widget is ready');
  });

  $widget.onPropsChanged((oldProps, newProps) => {
    // If your widget has properties, onPropsChanged is where you should handle changes to their values.
    console.log('Widget props changed', {
      oldProps,
      newProps,
    });
  });

  return {
    // If your app exposes a function in the api.ts file, make sure to return it here.
    myPublicFunction() { }
  };
});
