initial commit

This commit is contained in:
Dinawo
2024-06-11 23:18:25 +02:00
parent 6d8d5fcd6c
commit 8484a534db
3361 changed files with 493837 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
type UseSyncExternalStoreFn = <T>(subscribe: (fn: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
export declare const useSyncExternalStore: UseSyncExternalStoreFn;
export {};

View File

@@ -0,0 +1 @@
import*as e from"react";import{useSyncExternalStore as t}from'./useSyncExternalStoreShimClient.js';import{useSyncExternalStore as o}from'./useSyncExternalStoreShimServer.js';const r=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",s=!r,c=s?o:t,a="useSyncExternalStore"in e?(n=>n.useSyncExternalStore)(e):c;export{a as useSyncExternalStore};

View File

@@ -0,0 +1 @@
export declare function useSyncExternalStore<T>(subscribe: (fn: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T): T;

View File

@@ -0,0 +1 @@
import*as l from"react";function i(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const d=typeof Object.is=="function"?Object.is:i,{useState:u,useEffect:h,useLayoutEffect:f,useDebugValue:p}=l;let S=!1,_=!1;function y(e,t,c){const a=t(),[{inst:n},o]=u({inst:{value:a,getSnapshot:t}});return f(()=>{n.value=a,n.getSnapshot=t,r(n)&&o({inst:n})},[e,a,t]),h(()=>(r(n)&&o({inst:n}),e(()=>{r(n)&&o({inst:n})})),[e]),p(a),a}function r(e){const t=e.getSnapshot,c=e.value;try{const a=t();return!d(c,a)}catch{return!0}}export{y as useSyncExternalStore};

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export declare function useSyncExternalStore<T>(subscribe: (fn: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T): T;

View File

@@ -0,0 +1 @@
function t(r,e,n){return e()}export{t as useSyncExternalStore};