@hazae41/glacier
Version:
Yet another React data (re)fetching library
1 lines • 559 B
Source Map (JSON)
{"version":3,"file":"ref.cjs","sources":["../../../../../src/libs/react/ref.ts"],"sourcesContent":["import { useRef } from \"react\";\n\n/**\n * A ref whose content is updated on each render\n * @param current \n * @returns \n */\nexport function useRenderRef<T>(current: T) {\n const ref = useRef(current)\n ref.current = current\n return ref\n}"],"names":["useRef"],"mappings":";;;;AAEA;;;;AAIG;AACG,SAAU,YAAY,CAAI,OAAU,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGA,YAAM,CAAC,OAAO,CAAC,CAAA;AAC3B,IAAA,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;AACrB,IAAA,OAAO,GAAG,CAAA;AACZ;;;;"}