Skip to content

Commit db67090

Browse files
committed
Support for null actions
1 parent 86e7452 commit db67090

6 files changed

Lines changed: 11 additions & 6 deletions

File tree

dist/hyperapp-devtools.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hyperapp-devtools.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hyperapp-devtools.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hyperapp-devtools.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/enhanceActions.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { ActionEvent } from "./api";
22
export interface OnAction {
33
(call: ActionEvent): void;
44
}
5-
export declare function enhanceActions(onAction: OnAction, runId: string, actions?: any, prefix?: string): any;
5+
export declare function enhanceActions(onAction: OnAction, runId: string, actions: any, prefix?: string): any;
66
export default enhanceActions;

src/enhanceActions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ export interface OnAction {
77
export function enhanceActions(
88
onAction: OnAction,
99
runId: string,
10-
actions: any = {},
10+
actions: any,
1111
prefix?: string
1212
): any {
13+
if (!actions) {
14+
return null
15+
}
1316
var namespace = prefix ? prefix + "." : ""
1417
return Object.keys(actions).reduce(function(otherActions, name) {
1518
var fnName = actions[name].name || name

0 commit comments

Comments
 (0)