Skip to content

Multiple nested states #5

@switz

Description

@switz

Very often we have multiple boolean flags to represent a component and a single finite state does not reflect the UI we want to build. How might we design a more flexible driver to handle nested finite states?

const card = driver({
  states: {
    USER: {
      ADMIN: isAdmin,
      MEMBER: isMember,
      LOGGEDOUT: true,
    },
    CARD: {
      IS_DELETED: card.status === 'deleted',
    }
  },
});

Jotting down some notes, need to think more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions