Comparing version 0.9.1 to 0.9.2
@@ -633,3 +633,11 @@ 'use strict'; | ||
writeThunkQueueRef.current.push(thunk); | ||
runWriteThunk(lastStateRef, pendingStateRef, setState, contextUpdateRef.current, writeThunkQueueRef.current); | ||
if (lastStateRef.current) { | ||
runWriteThunk(lastStateRef, pendingStateRef, setState, contextUpdateRef.current, writeThunkQueueRef.current); | ||
} else { | ||
// force update (FIXME this is a workaround for now) | ||
setState(function (prev) { | ||
return mMerge(prev, mCreate()); | ||
}); | ||
} | ||
}); | ||
@@ -636,0 +644,0 @@ } |
@@ -628,3 +628,11 @@ var jotai = (function (exports, react, scheduler, useContextSelector) { | ||
writeThunkQueueRef.current.push(thunk); | ||
runWriteThunk(lastStateRef, pendingStateRef, setState, contextUpdateRef.current, writeThunkQueueRef.current); | ||
if (lastStateRef.current) { | ||
runWriteThunk(lastStateRef, pendingStateRef, setState, contextUpdateRef.current, writeThunkQueueRef.current); | ||
} else { | ||
// force update (FIXME this is a workaround for now) | ||
setState(function (prev) { | ||
return mMerge(prev, mCreate()); | ||
}); | ||
} | ||
}); | ||
@@ -631,0 +639,0 @@ } |
@@ -542,3 +542,9 @@ import { useLayoutEffect, useRef, useState, useEffect, useMemo, createElement, useDebugValue, useCallback } from 'react'; | ||
writeThunkQueueRef.current.push(thunk); | ||
runWriteThunk(lastStateRef, pendingStateRef, setState, contextUpdateRef.current, writeThunkQueueRef.current); | ||
if (lastStateRef.current) { | ||
runWriteThunk(lastStateRef, pendingStateRef, setState, contextUpdateRef.current, writeThunkQueueRef.current); | ||
} else { | ||
// force update (FIXME this is a workaround for now) | ||
setState(prev => mMerge(prev, mCreate())); | ||
} | ||
}) | ||
@@ -545,0 +551,0 @@ }), []); |
{ | ||
"name": "jotai", | ||
"private": false, | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "👻 Next gen state management that will spook you", | ||
@@ -6,0 +6,0 @@ "main": "index.cjs.js", |
@@ -177,2 +177,3 @@ <p align="center"> | ||
- [Utils Doc](./docs/utils.md) | ||
- [Immer Doc](./docs/immer.md) | ||
- [TypeScript Doc](./docs/typescript.md) | ||
@@ -179,0 +180,0 @@ - [Persistence Doc](./docs/persistence.md) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81952
2113
183