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.