From 6ebb5718bd52a3ddc62d4715236851552ff0b697 Mon Sep 17 00:00:00 2001 From: daishi Date: Thu, 1 Jul 2021 14:12:34 +0900 Subject: [PATCH] fix(core): write getter default parameter instead of optional parameter --- .size-snapshot.json | 12 ++++++------ src/core/vanilla.ts | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.size-snapshot.json b/.size-snapshot.json index 8ea14606c3..e1132231a5 100644 --- a/.size-snapshot.json +++ b/.size-snapshot.json @@ -1,8 +1,8 @@ { "index.js": { - "bundled": 21254, - "minified": 10166, - "gzipped": 3349, + "bundled": 21262, + "minified": 10169, + "gzipped": 3353, "treeshaked": { "rollup": { "code": 14, @@ -28,9 +28,9 @@ } }, "devtools.js": { - "bundled": 19114, - "minified": 9535, - "gzipped": 3277, + "bundled": 19122, + "minified": 9538, + "gzipped": 3281, "treeshaked": { "rollup": { "code": 28, diff --git a/src/core/vanilla.ts b/src/core/vanilla.ts index 5e4f0e9ace..d01988e257 100644 --- a/src/core/vanilla.ts +++ b/src/core/vanilla.ts @@ -407,7 +407,10 @@ const writeAtomState = ( }) return } - const writeGetter: WriteGetter = (a: AnyAtom, unstable_promise?: boolean) => { + const writeGetter: WriteGetter = ( + a: AnyAtom, + unstable_promise: boolean = false + ) => { const aState = readAtomState(state, a) if (aState.e) { throw aState.e // read error