import { jsx, jsxs, Fragment } from 'solid-jsx/jsx-runtime';

/*@jsxRuntime automatic @jsxImportSource solid-jsx*/
const toc = [];
function _createMdxContent(props) {
  const _components = Object.assign({
    p: "p",
    code: "code",
    pre: "pre",
    span: "span"
  }, props.components);
  return jsxs(Fragment, {
    children: [jsxs(_components.p, {
      children: ["For convenience, Solid has an ", jsx(_components.code, {
        children: "on"
      }), " helper that enables setting explicit dependencies for our computations. This is mostly used as a terse way to be even more explicit about which Signals are tracked (and not track any other Signals, even if they are read). In addition, ", jsx(_components.code, {
        children: "on"
      }), " provides a ", jsx(_components.code, {
        children: "defer"
      }), " option that allows the computation not to execute immediately and only run on first change."]
    }), "\n", jsxs(_components.p, {
      children: ["Let's have our Effect run only when ", jsx(_components.code, {
        children: "a"
      }), " updates, and defer execution until the value changes:"]
    }), "\n", jsx(_components.pre, {
      children: jsxs(_components.code, {
        className: "hljs language-js",
        children: [jsx(_components.span, {
          className: "hljs-title function_",
          children: "createEffect"
        }), "(", jsx(_components.span, {
          className: "hljs-title function_",
          children: "on"
        }), "(a, ", jsxs(_components.span, {
          className: "hljs-function",
          children: ["(", jsx(_components.span, {
            className: "hljs-params",
            children: "a"
          }), ") =>"]
        }), " {\n  ", jsx(_components.span, {
          className: "hljs-variable language_",
          children: "console"
        }), ".", jsx(_components.span, {
          className: "hljs-title function_",
          children: "log"
        }), "(a, ", jsx(_components.span, {
          className: "hljs-title function_",
          children: "b"
        }), "());\n}, { ", jsx(_components.span, {
          className: "hljs-attr",
          children: "defer"
        }), ": ", jsx(_components.span, {
          className: "hljs-literal",
          children: "true"
        }), " }));\n"]
      })
    })]
  });
}
function MDXContent(props = {}) {
  const {wrapper: MDXLayout} = props.components || ({});
  return MDXLayout ? jsx(MDXLayout, Object.assign({}, props, {
    children: jsx(_createMdxContent, props)
  })) : _createMdxContent(props);
}

export { MDXContent as default, toc };
//# sourceMappingURL=lesson-873b18f8.js.map
