Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.

Commit 3357075

Browse files
author
Austin McDaniel
committed
trying to improve aot compat
1 parent cfd53f2 commit 3357075

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ const STORE_KEY = '$STORE';
88
const ACTIONS_KEY = '$ACTIONS';
99

1010
export function Store(initialState: any = {}) {
11-
return (target: any) =>
11+
return function(target: any) {
1212
Reflect.defineMetadata(STORE_KEY, initialState, target);
13+
}
1314
}
1415

1516
export function Action(...klasses: any[]) {
16-
return (target: any, name: string, descriptor: TypedPropertyDescriptor < any > ) => {
17+
return function(target: any, name: string, descriptor: TypedPropertyDescriptor<any>) {
1718
const meta = Reflect.getMetadata(ACTIONS_KEY, target) || [];
1819
for (const klass of klasses) {
1920
const inst = new klass();
@@ -32,7 +33,7 @@ export function createReducer(klass: any) {
3233
const actions = Reflect.getMetadata(ACTIONS_KEY, klass.prototype);
3334
const instance = new klass();
3435

35-
return (state: any = initialState, action: any) => {
36+
return function(state: any = initialState, action: any) {
3637
if (actions) {
3738
const meta = actions.find(a => a.type === action.type);
3839
if (meta) {
@@ -52,7 +53,7 @@ export function createReducer(klass: any) {
5253
};
5354
}
5455

55-
export function ofAction <T extends Action> (...allowedTypes: any[]) {
56+
export function ofAction<T extends Action>(...allowedTypes: any[]) {
5657
return function ofTypeOperator(source$: Actions <T>): Actions <T> {
5758
return filter.call(source$, (action: any) => {
5859
return allowedTypes.some(a => {

0 commit comments

Comments
 (0)