Skip to content

Commit

Permalink
fix(framework): fix exported map types
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Nov 30, 2023
1 parent 23208fc commit 0826853
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/framework/src/container/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import type { Command } from "../Command.js";
import type { CommandPayload } from "../types/ArgumentsOf.js";
import { kCommands } from "./tokens.js";

export type CommandMap = Map<string, Command<CommandPayload>>;

export function createCommands<C = CommandMap>() {
export function createCommands<C extends Command = Command<CommandPayload>>() {
const commands = new Map<string, C>();
container.register(kCommands, { useValue: commands });
}
4 changes: 1 addition & 3 deletions packages/framework/src/container/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import type { Component } from "../Component.js";
import type { ComponentPayload } from "../types/ArgumentsOf.js";
import { kComponents } from "./tokens.js";

export type ComponentMap = Map<string, Component<ComponentPayload>>;

export function createComponents<C = ComponentMap>() {
export function createComponents<C extends Component = Component<ComponentPayload>>() {
const components = new Map<string, C>();
container.register(kComponents, { useValue: components });
}

0 comments on commit 0826853

Please sign in to comment.