16
17
export const FIXTURE_ENTRYPOINT = {
18
fn: Component,
19
- params: [{ value: { a: "a", continue: "skip", b: "b!" } }],
19
+ params: [{ value: { a: "a", continue: "skip", b: "hello!" } }],
20
+ sequentialRenders: [
21
+ { value: { a: "a", continue: "skip", b: "hello!" } },
22
+ { value: { a: "a", continue: "skip", b: "hello!" } },
23
+ { value: { a: "skip!", continue: true } },
24
+ { value: { a: "a", continue: "skip", b: "hello!" } },
25
+ { value: { a: "skip!", continue: true } },
26
+ { value: { a: "a", continue: "skip", b: "hello!" } },
27
+ { value: { a: "skip!", continue: true } },
28
+ { value: { a: "skip!", continue: true } },
29
+ ],
30
};
31
32
```
36
```javascript
37
import { unstable_useMemoCache as useMemoCache } from "react";
38
function Component(props) {
29
- const $ = useMemoCache(3);
39
+ const $ = useMemoCache(2);
40
let x;
31
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32
- let t0;
33
- if ($[1] !== props.value) {
34
- t0 = { ...props.value };
35
- $[1] = props.value;
36
- $[2] = t0;
37
- } else {
38
- t0 = $[2];
39
- }
40
- const object = t0;
41
+ if ($[0] !== props.value) {
42
+ const object = { ...props.value };
43
for (const y in object) {
44
if (y === "continue") {
45
continue;
47
48
x = object[y];
49
}
48
- $[0] = x;
50
+ $[0] = props.value;
51
+ $[1] = x;
52
} else {
50
- x = $[0];
53
+ x = $[1];
54
}
55
return x;
56
}
57
58
export const FIXTURE_ENTRYPOINT = {
59
fn: Component,
57
- params: [{ value: { a: "a", continue: "skip", b: "b!" } }],
60
+ params: [{ value: { a: "a", continue: "skip", b: "hello!" } }],
61
+ sequentialRenders: [
62
+ { value: { a: "a", continue: "skip", b: "hello!" } },
63
+ { value: { a: "a", continue: "skip", b: "hello!" } },
64
+ { value: { a: "skip!", continue: true } },
65
+ { value: { a: "a", continue: "skip", b: "hello!" } },
66
+ { value: { a: "skip!", continue: true } },
67
+ { value: { a: "a", continue: "skip", b: "hello!" } },
68
+ { value: { a: "skip!", continue: true } },
69
+ { value: { a: "skip!", continue: true } },
70
+ ],
71
};
72
73
```
74
75
### Eval output
63
-(kind: ok) "b!"
\ No newline at end of file
76
+(kind: ok) "hello!"
77
+"hello!"
78
+"skip!"
79
+"hello!"
80
+"skip!"
81
+"hello!"
82
+"skip!"
83
+"skip!"
\ No newline at end of file