-
Notifications
You must be signed in to change notification settings - Fork 1.2k
useRecoilCallback() snapshot gets the latest state #1610
Conversation
This pull request was exported from Phabricator. Differential Revision: D34236485 |
@drarmstr |
…tal#1610) Summary: Pull Request resolved: facebookexperimental#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses facebookexperimental#1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: 8a41e15556900dfb41628b2d77ea23409166f50a
This pull request was exported from Phabricator. Differential Revision: D34236485 |
0346702
to
9376272
Compare
…tal#1610) Summary: Pull Request resolved: facebookexperimental#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses facebookexperimental#1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: fc10621f4569bff753c1755b4c2e41601d6b8069
This pull request was exported from Phabricator. Differential Revision: D34236485 |
9376272
to
062de4c
Compare
Yes, it seems that our internal build avoids the circular dependency when using non-dereferencing imports while the open source build does not. I'll have to break the circular dependency another way. |
…tal#1610) Summary: Pull Request resolved: facebookexperimental#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses facebookexperimental#1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: b8c79540e1e86fe8228bd32b4f003b7254d17f88
062de4c
to
06d76e6
Compare
This pull request was exported from Phabricator. Differential Revision: D34236485 |
Summary: Pull Request resolved: facebookexperimental/Recoil#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses #1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: 0cb17cec40b50e8debeb57dc193b9f410d170fc5
Summary: Pull Request resolved: facebookexperimental/Recoil#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses #1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: 0cb17cec40b50e8debeb57dc193b9f410d170fc5
Summary: Pull Request resolved: facebookexperimental/Recoil#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses #1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: 0cb17cec40b50e8debeb57dc193b9f410d170fc5
Summary:
NOTE: This is a breaking change, but the previous approach had a bug.
Previously,
useRecoilCallback()
would attempt to provide aSnapshot
based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter.The new approach
useRecoilCallback()
will always try to get a snapshot with the latest state. This should also be more intuitive for users.Addresses #1604
Differential Revision: D34236485