UNPKG

@fruits-chain/react-native-xiaoshu

Version:
31 lines (25 loc) • 624 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createStyle = void 0; const StyleMap = new Map(); const createStyle = (componentVar, creator, tokens) => { let myStyle; for (let [key, value] of StyleMap) { if (key[1] === creator) { if (key[0] === componentVar) { myStyle = value; } else { StyleMap.delete(key); } } } if (!myStyle) { myStyle = creator(componentVar, tokens); StyleMap.set([componentVar, creator], myStyle); } return myStyle; }; exports.createStyle = createStyle; //# sourceMappingURL=create-style.js.map