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: ["It's sometimes desirable to have Signal reads not be tracked, even inside a reactive context. Solid provides the ", jsx(_components.code, {
        children: "untrack"
      }), " helper as a way to prevent the wrapping computation from tracking any reads."]
    }), "\n", jsxs(_components.p, {
      children: ["Let's suppose we did not want to log in our example when ", jsx(_components.code, {
        children: "b"
      }), " changes. We can untrack the ", jsx(_components.code, {
        children: "b"
      }), " signal by changing our effect to the following:"]
    }), "\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-function",
          children: "() =>"
        }), " {\n  ", jsx(_components.span, {
          className: "hljs-variable language_",
          children: "console"
        }), ".", jsx(_components.span, {
          className: "hljs-title function_",
          children: "log"
        }), "(", jsx(_components.span, {
          className: "hljs-title function_",
          children: "a"
        }), "(), ", jsx(_components.span, {
          className: "hljs-title function_",
          children: "untrack"
        }), "(b));\n});\n"]
      })
    }), "\n", jsxs(_components.p, {
      children: ["Since Signals are functions, they can be passed directly, but ", jsx(_components.code, {
        children: "untrack"
      }), " can wrap functions with more complex behavior."]
    }), "\n", jsxs(_components.p, {
      children: ["Even though ", jsx(_components.code, {
        children: "untrack"
      }), " disables tracking of reads, it has no effect on writes which still happen and notify their observers."]
    })]
  });
}
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-fb4b172f.js.map
