[examples] Log out the 'after' values of changes in StoreEventsExample (#2956)

The log statements in this were confusing me when I was inspecting style
changes the other day because when you changed some value from A
(before) to B (after) it only logged out the A value. I tried
experimenting with logging both A and B but it didn't feel necessary,
switching to only B feels fine.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package[^2]
This commit is contained in:
David Sheldrick 2024-02-26 15:42:50 +00:00 committed by GitHub
parent fb852459db
commit cf1c71fcd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,14 +42,16 @@ export default function StoreEventsExample() {
let diff = _.reduce( let diff = _.reduce(
from, from,
(result: any[], value, key: string) => (result: any[], value, key: string) =>
_.isEqual(value, (to as any)[key]) ? result : result.concat([key, value]), _.isEqual(value, (to as any)[key]) ? result : result.concat([key, (to as any)[key]]),
[] []
) )
if (diff?.[0] === 'props') { if (diff?.[0] === 'props') {
diff = _.reduce( diff = _.reduce(
(from as any).props, (from as any).props,
(result: any[], value, key) => (result: any[], value, key) =>
_.isEqual(value, (to as any).props[key]) ? result : result.concat([key, value]), _.isEqual(value, (to as any).props[key])
? result
: result.concat([key, (to as any).props[key]]),
[] []
) )
} }