Skip to content

Release 1.4.0

Compare
Choose a tag to compare
@tomas-light tomas-light released this 14 Feb 18:21
· 47 commits to main since this release

Features:

  • updated WatchedController type to be able to map changed action names in more convenient way:
@watch
export class UserController extends ControllerBase<State> {
  @watch('loadChatById') loadChatByIdFromSpecialStorage(action: Action<{ chatId: string }>) {/* ... */}
}

const typedController = (UserController as unknown) as WatchedController<UserController, {
  loadChatByIdFromSpecialStorage: 'loadChatById', // map original method name to the new one
}>;
export { typedController as UserController };
  • updated Action type, now method addNextAction returns action instance to be able to pass action chain right after extending in one line to the dispatch function:
    before:
interface Action<Payload = undefined> extends AnyAction {
  // ...
  addNextActions(...actions: (Action<any> | ActionFactory)[]): void;
}

after:

interface Action<Payload = undefined> extends AnyAction {
  // ...
  addNextActions(...actions: (Action<any> | ActionFactory)[]): Action<Payload>;
}