Smartjs Phase I (0.1) Release-AOP Three Musketeers

Source: Internet
Author: User

After a long time to finally released a bit of things, Smartjs is only recently started to engage in an open source JS library, the purpose is to do something more characteristic (Smartjs is also dependent on jquery for the time being).

Smartjs content planning is more, also can not be completed in a short time, the current small version of a function to accumulate.

The first edition of release 0.1 is primarily for the implementation of front-end aspect-oriented programming (AOP) support.

1. Promiseevent

Event-and promise-based callback management, similar to the callbacks of jquery, but with the functions of result passing, priority, event parameters, promise control, etc.

2. Trigger

Trigger, applying the trigger (AOP) feature on an object, the target object will have method injection capability (based on promiseevent), the injected type has before,after and round surround three kinds;

3. Flowcontroller

Process/life cycle controller, control process execution and flow, based on trigger

4. Common methods;

  //合并默认数据方法,将obj中空的内容从defObj中复制;与jquery的$.extend不通,只会加入不存在的数据
  st.mergeObj(deep, obj, defObj, exclude)

  //在目标对象方法中注入方法,返回结果
  st.injectFn(target, name, fn, before,stopOnFalse)

  //合并方法,返回结果
  st.mergeFn(fn, mergeFn,stopOnFalse)

In addition, I am sorry that the previously promised smartUI2.0 has not been completed, the idea has been changing, and these two years found that they can dominate the less time. However, there will be UI content in the Smartjs follow-up plan, and it will be equivalent to Smartui in Smartjs.

Post-trailer: Smartjs in version 0.2, some of the content that OOP supports is added.

Finally, the address of the smart address, there are more rich test cases, the API will be updated after the update blog one by one description.

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.