First glance at SmartJS-AOP sanjianke

Source: Internet
Author: User

SmartJS has a lot of content planning and cannot be completed in a short time. Currently, it is added up with functions of minor versions.

The content released in the first phase of version 0.1 is mainly to support front-end Aspect-oriented programming (AOP.

1. PromiseEvent

Callback management based on events and promise is similar to callbacks of jquery, but it has functions such as result passing, priority, event parameters, and promise control.

2. Trigger

Trigger: Apply the trigger (aop) function on the object. The target object will have the method injection function (based on promiseEvent). The injection types include before, after, and round;

3. FlowController

Process/lifecycle controller, which controls the execution and flow of processes based on Trigger

4. Common methods;

// Merge the default data method, and copy the hollow obj content from defObj. It is not connected to $. extend of jquery and only adds non-existent data.
St. mergeObj (deep, obj, defObj, exclude)

// Inject the method into the target object method and return the result
St. injectFn (target, name, fn, before, stopOnFalse)

// Merge method and return results
St. mergeFn (fn, mergeFn, stopOnFalse)

In addition, I am very sorry for the fact that the previously promised smartUI2.0 has not been completed, and the idea has been changing. In the past two years, I found that I have been able to spend less and less time. However, there will also be ui content in the future planning of smartjs, which is equivalent to deploying smartUI in Smartjs.

Later notice: some content supported by oop will be added to smartjs 0.2.

The smart address is attached, which contains a wide range of test cases. The api will be updated in the future.

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.