You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When classed get wrapped on Facade using useFacade helper, all class properties and getter is not accessible. This is because Facade __getStatic magic method only triggered when we access class method. I think this code will fix this issue. Tested on another project using vitest.
static__getStatic(name: string,abstract: string |symbol){// before, we didn't check target property here // because this.app is still undefined here due to static method// so by using app(), we can rebind app herelettarget: any;if(!this.app&&app()){this.setApplicationFacade(app());target=this.resolveFacadeInstance(abstract);// Tara... we can access target getter or property hereif(target[name]){returntarget[name];}}return(...args: any)=>{// if target not resolved before, resolve hereif(!target){target=this.resolveFacadeInstance(abstract);}// this for checking Route facade is being calledif(target.facadeCalled){target.facadeCalled();}// check method is callable in instanceif(target[name]){returntarget[name].call(target, ...args);}// check method is callable in classif(target.constructor){if(target.constructor[name]){returntarget.constructor[name].call(target.constructor, ...args);}}thrownewBadMethodCallException(`Method ${target.constructor.name}.${name} does not exist.`);};}
The text was updated successfully, but these errors were encountered:
When classed get wrapped on Facade using
useFacade
helper, all class properties and getter is not accessible. This is because Facade __getStatic magic method only triggered when we access class method. I think this code will fix this issue. Tested on another project using vitest.The text was updated successfully, but these errors were encountered: