// B3 H4's bench (docs/blitz-bevy.feature): a composition reading and writing a resource the App shares // (bench/bridge/examples/shared_state.rs). React sets the score to 100 (); a Bevy system counts up from there; // the text shows the World's value as it comes back. import { AbsoluteFill, Composition, registerRoot } from "raea"; import { resource } from "raea/bevy"; import { Resource, useResource } from "raea/ecs"; const Score = resource<{ points: number }>("bench::Score"); function Shot() { const score = useResource(Score); return (
{score ? `score ${score.points}` : "score none"}
); } registerRoot(() => );