Comparing version
@@ -1,13 +0,7 @@ | ||
/// <reference types="es6-promise" /> | ||
import ActionContext from './ActionContext'; | ||
export interface RawAction { | ||
(...args: any[]): Promise<any> | void; | ||
} | ||
export interface Action { | ||
actionType?: string; | ||
} | ||
import RawAction from './RawAction'; | ||
export interface ActionFactory { | ||
<T extends RawAction>(target: T): T & Action; | ||
<T extends RawAction>(target: T): T; | ||
<T extends RawAction>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): void; | ||
} | ||
export default function action(actionType: string, actionContext?: ActionContext): ActionFactory; |
@@ -24,4 +24,4 @@ "use strict"; | ||
}; | ||
decoratedTarget.actionType = actionType; | ||
functionInternals_1.setOriginalTarget(decoratedTarget, target); | ||
functionInternals_1.setActionType(decoratedTarget, actionType); | ||
return decoratedTarget; | ||
@@ -28,0 +28,0 @@ } |
@@ -0,2 +1,5 @@ | ||
import RawAction from './RawAction'; | ||
export declare function setOriginalTarget(decoratedTarget: any, originalTarget: any): void; | ||
export declare function getOriginalTarget(decoratedTarget: any): any; | ||
export declare function setActionType(decoratedTarget: any, actionType: string): void; | ||
export declare function getActionType(decoratedTarget: RawAction): any; |
@@ -13,2 +13,10 @@ "use strict"; | ||
exports.getOriginalTarget = getOriginalTarget; | ||
function setActionType(decoratedTarget, actionType) { | ||
decoratedTarget.__SATCHELJS_ACTION_TYPE = actionType; | ||
} | ||
exports.setActionType = setActionType; | ||
function getActionType(decoratedTarget) { | ||
return decoratedTarget.__SATCHELJS_ACTION_TYPE; | ||
} | ||
exports.getActionType = getActionType; | ||
//# sourceMappingURL=functionInternals.js.map |
@@ -12,3 +12,4 @@ export { default as rootStore } from './rootStore'; | ||
export { default as createUndo, UndoResult, CreateUndoReturnValue } from './createUndo'; | ||
export { getActionType } from './functionInternals'; | ||
export { initializeTestMode, resetTestMode } from './testMode'; | ||
export { useStrict } from './useStrict'; |
@@ -16,2 +16,4 @@ "use strict"; | ||
exports.createUndo = createUndo_1.default; | ||
var functionInternals_1 = require("./functionInternals"); | ||
exports.getActionType = functionInternals_1.getActionType; | ||
var testMode_1 = require("./testMode"); | ||
@@ -18,0 +20,0 @@ exports.initializeTestMode = testMode_1.initializeTestMode; |
@@ -84,2 +84,3 @@ "use strict"; | ||
}; | ||
functionInternals_1.setActionType(returnValue, functionInternals_1.getActionType(target)); | ||
return returnValue; | ||
@@ -86,0 +87,0 @@ }; |
{ | ||
"name": "satcheljs", | ||
"version": "2.12.0", | ||
"version": "2.13.0", | ||
"description": "Store implementation for functional reactive flux.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46879
2.68%58
5.45%561
2.75%