MCPcopy
hub / github.com/statelyai/xstate / Counter

Function Counter

packages/xstate-solid/test/fromActorRef.test.tsx:1119–1134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1117 const counterService = createActor(counterMachine).start();
1118
1119 const Counter = () => {
1120 const snapshot = fromActorRef(counterService);
1121
1122 return (
1123 <div
1124 data-testid="count"
1125 onclick={() => {
1126 counterService.send({ type: 'INC' });
1127 // @ts-expect-error
1128 counterService.send({ type: 'FAKE' });
1129 }}
1130 >
1131 {snapshot().context.count}
1132 </div>
1133 );
1134 };
1135
1136 render(() => (
1137 <div>

Callers

nothing calls this directly

Calls 5

fromActorRefFunction · 0.90
createActorFunction · 0.85
onFunction · 0.85
sendMethod · 0.80
startMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…