Skip to content
Discussion options

You must be logged in to vote

I believe that we should stick to a single way of importing things.

  1. either stop exporting individual actions and just leave the actions export:
import { actions } from 'xstate'
actions.assign(/* ... */)
  1. or do the same but move actions to a separate entry:
import * as actions from 'xstate/actions'
actions.assign(/* ... */)

import { send } from 'xstate/actions'
send(/* ... */)
  1. or just export everything "flat" from the root entry and remove the actions export
import { assign } from 'xstate'
assign(/* ... */)

Personally, I would rank them in such order: 2 > 3 > 1

Note that I have also been maintaining a fairly popular project: redux-saga that comes with a very similar redux-saga/effects

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@davidkpiano
Comment options

@tomByrer
Comment options

Answer selected by tomByrer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants