UNPKG

@fruits-chain/react-native-xiaoshu

Version:
22 lines (19 loc) 434 B
const StyleMap = new Map(); export const widthStyle = (vars, creator) => { let myStyle; for (let [key, value] of StyleMap) { if (key[1] === creator) { if (key[0] === vars) { myStyle = value; } else { StyleMap.delete(key); } } } if (!myStyle) { myStyle = creator(vars); StyleMap.set([vars, creator], myStyle); } return myStyle; }; //# sourceMappingURL=width-style.js.map