this repo has no description
at v1.0.0 752 B view raw
1import { ExtensionWebpackModule } from "@moonlight-mod/types"; 2 3export const stores: ExtensionWebpackModule = { 4 dependencies: [{ ext: "common", id: "flux" }], 5 run: (module, exports, require) => { 6 const Flux = require("common_flux"); 7 8 module.exports = new Proxy( 9 {}, 10 { 11 get: function (target, key, receiver) { 12 const allStores = Flux.Store.getAll(); 13 14 let targetStore; 15 for (const store of allStores) { 16 const name = store.getName(); 17 if (name.length == 1) continue; // filter out unnamed stores 18 19 if (name == key) { 20 targetStore = store; 21 break; 22 } 23 } 24 25 return targetStore; 26 } 27 } 28 ); 29 } 30};