Skip to content

Commit

Permalink
fixup! refactor: Store startPoint, waypoints, and endPoint as separat…
Browse files Browse the repository at this point in the history
…e pieces of context
  • Loading branch information
joshlarson authored and firestack committed May 29, 2024
1 parent 8421c70 commit b684c6d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions assets/src/hooks/useDetour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export enum DetourState {

export const useDetour = ({ routePatternId, shape }: OriginalRoute) => {
const [snapshot, send] = useMachine(createDetourMachine)
const startPoint = snapshot.context.startPoint
const endPoint = snapshot.context.endPoint
/** The detour waypoints in-between the start and end point */
const waypoints = snapshot.context.waypoints
const { startPoint, endPoint, waypoints } = snapshot.context
const allPoints = useMemo(() => {
if (!startPoint) {
return []
Expand Down

0 comments on commit b684c6d

Please sign in to comment.