Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support to each action #179

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RodolfoSilva
Copy link
Contributor

Description

The idea of this action is to allow the user to perform sequential actions when necessary. For example, when the user clicks on a button, this action should show a toast and send a request to the server.
Or copy something to the clipboard and show a dialog.

So we can declare this like that:

{
  "type": "textButton",
  "child": {
    "type": "text",
    "data": "BUTTON"
  },
  "onPressed": {
    "actionType": "each",
    "actions": [
      {
        "actionType": "copyToClipBoard",
        "value": "Some value"
      },
      {
        "actionType": "showToast",
        "value": "Value copied to clipboard"
      },
      {
        "actionType": "vibrate",
        "pattern": [0, 1, 1, 0, 1, 0, 1, 1, 1]
      }
    ]
  }
}

Related Issues

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

@RodolfoSilva
Copy link
Contributor Author

This is just a proposal @i-asimkhan, @divyanshub024?

Do you have any suggestions?

@i-asimkhan
Copy link
Contributor

This is just a proposal @i-asimkhan, @divyanshub024?

Do you have any suggestions?

@RodolfoSilva This is a great idea, we really were looking for this. Let's discuss the naming and other stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants