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: ["为方便起见，Solid 提供一个 ", jsx(_components.code, {
        children: "on"
      }), " 工具函数，可以为我们的计算设置显式依赖。这主要用来更明确地简洁地声明跟踪哪些信号。然而，它也允许计算不立即执行而只在第一次更改时运行。可以使用", jsx(_components.code, {
        children: "defer"
      }), " 选项启用此功能。"]
    }), "\n", jsxs(_components.p, {
      children: ["让 Effect 只在 ", jsx(_components.code, {
        children: "a"
      }), " 更新时运行，并推迟到值发生变化时执行。"]
    }), "\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-a12534d3.js.map
