File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11# jotai-x
22
3+ ## 2.1.2
4+
5+ ### Patch Changes
6+
7+ - Add ` suppressWarnings ` option to ` createAtomStore ` options to control store-level warning behavior when accessing store outside provider
8+
39## 2.1.1
410
511### Patch Changes
Original file line number Diff line number Diff line change 11{
22 "name" : " jotai-x" ,
3- "version" : " 2.1.1 " ,
3+ "version" : " 2.1.2 " ,
44 "description" : " Jotai store factory for a best-in-class developer experience." ,
55 "license" : " MIT" ,
66 "homepage" : " https://jotai-x.udecode.dev/" ,
Original file line number Diff line number Diff line change @@ -442,6 +442,7 @@ export interface CreateAtomStoreOptions<
442442 effect ?: React . FC ;
443443 extend ?: ( atomsWithoutExtend : StoreAtomsWithoutExtend < T > ) => E ;
444444 infiniteRenderDetectionLimit ?: number ;
445+ suppressWarnings ?: boolean ;
445446}
446447
447448/**
@@ -468,6 +469,7 @@ export const createAtomStore = <
468469 effect,
469470 extend,
470471 infiniteRenderDetectionLimit = 100_000 ,
472+ suppressWarnings,
471473 } : CreateAtomStoreOptions < T , E , N >
472474) : AtomStoreApi < T , E , N > => {
473475 type MyStoreAtoms = StoreAtoms < T , E > ;
@@ -524,7 +526,7 @@ export const createAtomStore = <
524526 const {
525527 scope,
526528 store,
527- warnIfNoStore = true ,
529+ warnIfNoStore = ! suppressWarnings ,
528530 } = convertScopeShorthand ( optionsOrScope ) ;
529531 const contextStore = useAtomStore ( name , scope , ! store && warnIfNoStore ) ;
530532 return store ?? contextStore ;
Original file line number Diff line number Diff line change 11import '@testing-library/jest-dom' ;
22
33jest . spyOn ( global . console , 'warn' ) . mockImplementation ( ( ) => jest . fn ( ) ) ;
4+ jest . spyOn ( global . console , 'error' ) . mockImplementation ( ( ) => jest . fn ( ) ) ;
You can’t perform that action at this time.
0 commit comments