New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate `executor()` #356

Open
azu opened this Issue Aug 25, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@azu
Member

azu commented Aug 25, 2018

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 #355
  • Deprecated warning message #355
  • Migration tools for TypeScript almin/migration-tools#5
  • Drop to support (Probably 1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment