JSTQL-JS-Transform/output_testing/910prune-scopes-whose-deps-may-invalidate-array.js

17 lines
344 B
JavaScript
Raw Normal View History

import { useHook, identity } from "shared-runtime";
function Component(props) {
let x = 42;
if (props.cond) {
x = [];
}
useHook(); // intersperse a hook call to prevent memoization of x
x |> identity(%);
const y = [x];
return [y];
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{
value: "sathya"
}]
};