UNPKG

@hazae41/glacier

Version:

Yet another React data (re)fetching library

1 lines 548 B
{"version":3,"file":"ref.mjs","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":[],"mappings":";;AAEA;;;;AAIG;AACG,SAAU,YAAY,CAAI,OAAU,EAAA;AACxC,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC3B,IAAA,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;AACrB,IAAA,OAAO,GAAG,CAAA;AACZ;;;;"}