Typescript definition & non serializable state
Closed this issue · 3 comments
michael-haberzettel commented
Hello,
Thanks for this project. I really like how the fsm must be implemented with fluent syntax.
I have found 2 issues when i'm trying to using automata in my project :
- typescript definition is not working. Index.d.ts is missing from package
- isInvokable is great idea but it's generate non serializable store. Do you think is it possible to move this function outside state object ? Some middleware & checkers (for example : https://redux-toolkit.js.org/api/other-exports#createserializablestateinvariantmiddleware) can complains about that.
Thanks in advance.
offbeatful commented
Hi, thanks for your feedback. Version 2.6.1 has types fixed.
I understand the issue with canInvoke
. I am working on a PR to solve that.
offbeatful commented
@michael-haberzettel Please review attached PR #9. I am removing state.canInvoke
in favor of action.isInvokable
. If that works for you - please let me know and I merge it in.
@connect(
(state: ResponseState) => ({
response: state,
canRefresh: Refresh.isInvokable(state) // <<<<<< EXAMPLE
}),
)
michael-haberzettel commented
Hello @offbeatful
Thanks for version 2.6.1with typing definitions, I will continue the discussion in the associated PR.