GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript/JavaScript-Design-Patterns/Chaining at master · wchaowu/javascript

Expand file tree

/

Chaining

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

Chaining

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
1-Introduction to chaining.js
1-Introduction to chaining.js
 
 
3-Building a chainable JavaScript library.js
3-Building a chainable JavaScript library.js
 
 
3-The structure of the chain.js
3-The structure of the chain.js
 
 
4-Using callbacks.js
4-Using callbacks.js
 
 
README.md
README.md
 
 

README.md

方法的链式调用
Javascript中的对象是作为引用被传递的,所以可以让每个方法都传回对象的引用,即返回this值;
这种编程风格可以简化代码的编写工作,让代码更简洁易读,
示例程序

为了解决命名冲突,使用指定的API,可以为框架提供一个安装器
示例程序

如果想让getter和setter方法都支持链式调用,可以在getter方法中使用回调技术, 示例程序

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.