Skip to content

Commit 36e193c

Browse files
authored
fix(devframe): add force? param to RpcFunctionsCollector register/update (#91)
1 parent 46b0ccc commit 36e193c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/devframe/src/rpc/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ export interface RpcFunctionsCollector<LocalFunctions, SetupContext = undefined>
7272
readonly functions: LocalFunctions
7373
/** Map of registered function definitions keyed by function name */
7474
readonly definitions: Map<string, RpcFunctionDefinitionAnyWithContext<SetupContext>>
75-
/** Register a new function definition */
76-
register: (fn: RpcFunctionDefinitionAnyWithContext<SetupContext>) => void
77-
/** Update an existing function definition */
78-
update: (fn: RpcFunctionDefinitionAnyWithContext<SetupContext>) => void
75+
/** Register a new function definition. Pass `force` to overwrite an existing one. */
76+
register: (fn: RpcFunctionDefinitionAnyWithContext<SetupContext>, force?: boolean) => void
77+
/** Update an existing function definition. Pass `force` to register it if it doesn't exist yet. */
78+
update: (fn: RpcFunctionDefinitionAnyWithContext<SetupContext>, force?: boolean) => void
7979
/** Subscribe to function changes, returns unsubscribe function */
8080
onChanged: (fn: (id?: string) => void) => (() => void)
8181
}

0 commit comments

Comments
 (0)