Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Gregory Beaver
    @cellog
    worth documenting :) thanks for that
    really appreciate the work put into this, and into advocating for state machines in general. I'm refactoring a simple dialog that loads some state asynchronously, which currently has an implicit machine and TONS of race condition bugs
    namibj
    @namibj
    @cellog @tomclose @davidkpiano If you could tell me which code basis to work on, and confirm that the ability to
    supply actions via withConfig while retaining type-safety as being desired, I'd try to poke at it later today (in a couple hours). I could use the mood
    boost of writing a desired/requested PR, and I should up my dependantly typed TypeScript skills.
    Gregory Beaver
    @cellog
    I'm new here, I defer to others
    namibj
    @namibj
    @cellog well, you're an active user of xstate and apparently have a use case for type-safety in providing actions in withConfig.
    how to solve this error?
    David Khourshid
    @davidkpiano
    That's not an XState question
    Right?
    namibj
    @namibj
    @davidkpiano yes. It's basically just a typescript issue.
    kapilpipaliya
    @kapilpipaliya
    thanks, do i have to write .d.ts file for module?
    i am using this library: https://github.com/snd/url-pattern
    kapilpipaliya
    @kapilpipaliya
    i modified https://github.com/snd/url-pattern/blob/master/index.d.ts#L21 to export default UrlPattern in node_modules and it works. thanks
    namibj
    @namibj
    @kapilpipaliya You should have been fine using the require() syntax described there.
    Huy Nguyen
    @imhuyqn
    hello folks
    do we currently have any repo using xState with Typescript?
    I'd love to see some examples
    thank you very much!
    namibj
    @namibj
    Yes. Scroll up to the "monorepo" links.
    Huy Nguyen
    @imhuyqn
    on the very top of this chat?
    this?
    namibj
    @namibj
    @imhuyqn Yes, that one.
    Huy Nguyen
    @imhuyqn
    nice, thank you!
    do we have any comparison between xstate and unstated-next?
    namibj
    @namibj
    @imhuyqn If you find a codesanbox.io "sandbox" for the xstate-wallet or some other more serious xstate + typescript repo, let me know.
    Do you have a link for the unstated-next? Specifically, some overview/FAQ?
    Huy Nguyen
    @imhuyqn
    that one
    namibj
    @namibj
    @imhuyqn Well, unstated-next doesn't do state machine stuff. Are you familiar with Harel's Statecharts, from a concept perspective?
    Huy Nguyen
    @imhuyqn
    no
    I am thinking of xstate as a Redux alternative
    should I read from this?
    namibj
    @namibj
    Yes, there are good ressources. If you want to understand the why/concepts/origins, I can suggest the original http://www.inf.ed.ac.uk/teaching/courses/seoc/2005_2006/resources/statecharts.pdf , and if you want to read a more modern, polished guide to creating them in practice, I might suggest the IBM docs (they're in the context of one of their tools, but the concepts are the same for xstate): https://www.ibm.com/support/knowledgecenter/SSB2MU_8.3.0/com.ibm.rhp.uml.diagrams.doc/topics/rhp_c_dm_designing_stchrts.html
    Huy Nguyen
    @imhuyqn
    nice, thank you!
    namibj
    @namibj
    @imhuyqn In retrospect, I can't recommend the IBM guide as much as I thought. The link you shared is far better for understanding the concepts.
    Huy Nguyen
    @imhuyqn
    ah I see
    I really like this one
    Huy Nguyen
    @imhuyqn
    the drawbacks of using state machines are not very clear in the documents
    so it has higher entry barrier for developers but is it easier to maintain the codebase once you grasp the core concept of state machine?
    namibj
    @namibj
    Basically. Though, state machines have significant scaling issues, which is why Harel conceptualized the StateChart.
    kapilpipaliya
    @kapilpipaliya
    @namibj thanks
    mzinbergs
    @mzinbergs
    It appears that it's not possible to fire an action when entering a "final" state. Is that correct?