Open
Description
UseCaseExecutor#executor
has been introduced as a workaround of " TypeScript: improve UseCase#execute typing #107 ".
In Almin 0.18+, UseCaseExecutor#execute
type will be complete in #355
📝 Require TypeScript 3.0+
The user should use UseCaseExecutor#execute
instead of UseCaseExecutor#executor
.
Changes
Before: executor()
import { UseCase, Context } from "almin";
class MyUseCaseA extends UseCase {
execute(_a: string) {}
}
const context = new Context({
store: createStore({ name: "test" })
});
// executor
context.useCase(new MyUseCaseA()).executor(useCase => useCase.execute("A"));
After: execute()
import { UseCase, Context } from "almin";
class MyUseCaseA extends UseCase {
execute(_a: string) {}
}
const context = new Context({
store: createStore({ name: "test" })
});
//execute
context.useCase(new MyUseCaseA()).execute("A");
Migration
almin/migration-tools support this changes.
Apply 0.17.x → 0.18.x migration or --script "executor-to-execute"
# TypeScript
$ almin-migration-tools "src/**/*.{ts,tsx}" --script "executor-to-execute"
# JavaScript
$ almin-migration-tools "src/**/*.{js}" --script "executor-to-execute"
Task
- Deprecated
UseCaseExecutor#executor
fix(almin): makeUseCaseExecutor#execute
type complete #355 - Deprecated warning message fix(almin): make
UseCaseExecutor#execute
type complete #355 - Migration tools for TypeScript feat(almin): Almin 0.15.x → 0.18.x migration-tools#5
- Drop to support (Probably 1.0)