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.