Skip to content

Fix create deep signal#781

Merged
atk merged 2 commits intosolidjs-community:mainfrom
juanrgm:fix-create-deep-signal
Mar 27, 2025
Merged

Fix create deep signal#781
atk merged 2 commits intosolidjs-community:mainfrom
juanrgm:fix-create-deep-signal

Conversation

@juanrgm
Copy link
Copy Markdown
Contributor

@juanrgm juanrgm commented Mar 26, 2025

The setter of createDeepSignal is not working if you pass a non-function value.

const [data, { mutate }] = createResource(() => ({ counter: 1 }), {
  storage: createDeepSignal,
});
// mutate(() => ({ counter: 2 })); // works
mutate({ counter: 2 }); // not working
createEffect(() => {
  console.log(data()?.counter); // 1
});

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 26, 2025

🦋 Changeset detected

Latest commit: 9914bfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@solid-primitives/resource Patch
@solid-primitives/db-store Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/resource/src/index.ts
@atk atk merged commit 4af32ec into solidjs-community:main Mar 27, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants