Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createWritableMemo() doesn't work with undefined #592

Open
astoilkov opened this issue Mar 27, 2024 · 0 comments
Open

createWritableMemo() doesn't work with undefined #592

astoilkov opened this issue Mar 27, 2024 · 0 comments

Comments

@astoilkov
Copy link

astoilkov commented Mar 27, 2024

Describe the bug

Passing undefined to the createWritableMemo() setter doesn't update the memo toundefined.

import { createWritableMemo } from "@solid-primitives/memo";

const [count, setCount] = createSignal(1);
const [result, setResult] = createWritableMemo(() => count() * 2);
result(); // => 2
setResult(undefined); // overwrites calculation result
result(); // => 2 ❌ incorrect it should be undefined

Minimal Reproduction Link

https://playground.solidjs.com/anonymous/76de3e3d-d0e1-457f-8d50-1cebfead6c1c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant