core-native
Version:
A lightweight framework based on React Native + Redux + Redux Saga, in strict TypeScript.
14 lines (11 loc) • 552 B
text/typescript
import {type ActionHandler, type TickIntervalDecoratorFlag} from "../module";
type OnTickHandlerDecorator = (target: object, propertyKey: "onTick", descriptor: TypedPropertyDescriptor<ActionHandler & TickIntervalDecoratorFlag>) => TypedPropertyDescriptor<ActionHandler>;
/**
* For *onTick() action only, to specify to tick interval in second.
*/
export function Interval(second: number): OnTickHandlerDecorator {
return (target, propertyKey, descriptor) => {
descriptor.value!.tickInterval = second;
return descriptor;
};
}