13 lines
380 B
JavaScript
13 lines
380 B
JavaScript
|
function Component(props) {
|
||
|
const env = useRelayEnvironment();
|
||
|
// Note: this is a class has no mutable methods, ie it always treats `this` as readonly
|
||
|
const mutator = new Mutator(env);
|
||
|
useOtherHook();
|
||
|
|
||
|
// `x` should be independently memoizeable, since foo(x, mutator) cannot mutate
|
||
|
// the mutator.
|
||
|
const x = {};
|
||
|
x |> foo(%, mutator);
|
||
|
return x;
|
||
|
}
|
||
|
class Mutator {}
|