|
@@ -2,11 +2,20 @@ import _ from 'lodash'
|
|
import {FunctionRegiste} from "../types"
|
|
import {FunctionRegiste} from "../types"
|
|
import {Scope} from "../Scope"
|
|
import {Scope} from "../Scope"
|
|
|
|
|
|
-export const LibList: FunctionRegiste[] = []
|
|
|
|
|
|
+export function getRegList() {
|
|
|
|
+ let regList = _.get(window, 'yvanLib.regList')
|
|
|
|
+ if (!regList) {
|
|
|
|
+ regList = []
|
|
|
|
+ _.set(window, 'yvanLib.regList', regList)
|
|
|
|
+ }
|
|
|
|
+ return regList
|
|
|
|
+}
|
|
|
|
|
|
export function Lib(registe: FunctionRegiste) {
|
|
export function Lib(registe: FunctionRegiste) {
|
|
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
|
|
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
|
|
- LibList.push({
|
|
|
|
|
|
+ const libList = getRegList()
|
|
|
|
+ console.log("libregiste", target[propertyKey], libList.length)
|
|
|
|
+ libList.push({
|
|
...registe,
|
|
...registe,
|
|
name: propertyKey,
|
|
name: propertyKey,
|
|
target: target[propertyKey]
|
|
target: target[propertyKey]
|