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

value parameter of createEffect is not passed to on as prevValue when defer is true. #2065

Closed
vveisard opened this issue Feb 8, 2024 · 1 comment

Comments

@vveisard
Copy link

vveisard commented Feb 8, 2024

Describe the bug

The value parameter of createEffect is not passed to on as prevValue when defer is true.

Your Example Website or App

https://playground.solidjs.com/anonymous/61004170-6d09-4ce2-9582-ce966c7a131d

Steps to Reproduce the Bug or Issue

  1. Go to https://playground.solidjs.com/anonymous/61004170-6d09-4ce2-9582-ce966c7a131d
  2. Observe Console tab in Result panel that prevValue is undefined for the on block when defer: true.
on with defer: true
    1 undefined undefined

Expected behavior

As a user, I expect value parameter of createEffect to be passed to on as prevValue when defer: true.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Microsoft Edge
  • Version: 121.0.2277.98 (Official build) (64-bit)

Additional context

Perhaps I am misunderstanding the desired behavior of OnOptions.defer, but this seems like a bug to me.

@ryansolid
Copy link
Member

Yeah you are right. We returnundefined from the first defer run but we should probably forward the prevValue

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

2 participants