statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
26.98k stars 1.24k forks source link

Bug: [@xstate/store] typings broken #4859

Closed wcastand closed 4 months ago

wcastand commented 5 months ago

XState version

XState version 5

Description

the transition event is broken when i pass a type to create.

because i try to access event: { newContext } but types expect update to possibly also be {type: update} which breaks the types.

Couldn't find an example in your repo on typing stores so maybe i'm doing it wrong.

Expected result

type to not show an error

Actual result

showing a type error when passing the update fn

Reproduction

https://replit.com/join/ifbbvxzfvf-wcastand

Additional context

No response

davidkpiano commented 4 months ago

Can you try with the latest version?

wcastand commented 4 months ago

looks fixed, thanks :)