refactor: entity -> MutableSignal
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
PlayerType,
|
||||
getBoardRegion,
|
||||
} from '@/samples/boop';
|
||||
import {Entity} from "@/utils/entity";
|
||||
import {MutableSignal} from "@/utils/entity";
|
||||
import {createGameContext} from "@/";
|
||||
import type { PromptEvent } from '@/utils/command';
|
||||
|
||||
@@ -25,7 +25,7 @@ function createTestContext() {
|
||||
return { registry, ctx };
|
||||
}
|
||||
|
||||
function getState(ctx: ReturnType<typeof createTestContext>['ctx']): Entity<BoopState> {
|
||||
function getState(ctx: ReturnType<typeof createTestContext>['ctx']): MutableSignal<BoopState> {
|
||||
return ctx.state;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ function waitForPrompt(ctx: ReturnType<typeof createTestContext>['ctx']): Promis
|
||||
});
|
||||
}
|
||||
|
||||
function getParts(state: Entity<BoopState>) {
|
||||
function getParts(state: MutableSignal<BoopState>) {
|
||||
return state.value.pieces;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
TicTacToeState,
|
||||
WinnerType, PlayerType
|
||||
} from '@/samples/tic-tac-toe';
|
||||
import {Entity} from "@/utils/entity";
|
||||
import {MutableSignal} from "@/utils/mutable-signal";
|
||||
import {createGameContext} from "@/";
|
||||
import type { PromptEvent } from '@/utils/command';
|
||||
|
||||
@@ -17,7 +17,7 @@ function createTestContext() {
|
||||
return { registry, ctx };
|
||||
}
|
||||
|
||||
function getState(ctx: ReturnType<typeof createTestContext>['ctx']): Entity<TicTacToeState> {
|
||||
function getState(ctx: ReturnType<typeof createTestContext>['ctx']): MutableSignal<TicTacToeState> {
|
||||
return ctx.state;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user