We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class Receiver { //我是接收者 execute() { console.log("接收者执行请求"); } } class Command { //我是命令对象 constructor(receiver) { this.receiver = receiver; } execute() { // 调用接收者对应接口执行 console.log("命令对象处理发布者请求"); this.receiver.execute(); } } class Invoker { //我是发布者 constructor(command) { this.command = command; } invoke() { // 调用命令 console.log("发布者发布请求"); this.command.execute(); } } const receiver = new Receiver(); const command = new Command(receiver); const invoker = new Invoker(command); invoker.invoke();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: