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

enh: async dynamic generator actions #420

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benallfree
Copy link
Collaborator

This update makes it possible to use a dynamic actions function that returns a promise. It's helpful for situations where building the final actions list requires async calls.

@benallfree benallfree changed the title Enhancement: async generator actions Enhancement: async dynamic generator actions Mar 13, 2024
@akaguny
Copy link

akaguny commented Apr 3, 2024

i'm also need this feature!
in logic that change looks like "simple dimple"
change
actions = actions(data);
to
actions = await actions(data);
in the condition

    // if action is a function, run it to get our array of actions
    if (typeof actions === "function") {
      actions = await actions(data);
    }

if actions function is async then we wait, in another way nothing changed.
yes, it can maybe be a little slowly, but is that really matter and if we have benchmarks we can check

@benallfree
Copy link
Collaborator Author

Yep and it seems to work 100%!

@akaguny
Copy link

akaguny commented Apr 4, 2024

@benallfree , you know what we should do for the next iteration of the implementation?

@benallfree
Copy link
Collaborator Author

The PR is ready & awaiting approval. What do you mean next iteration?

@benallfree benallfree changed the title Enhancement: async dynamic generator actions enhancement: async dynamic generator actions Apr 21, 2024
@benallfree benallfree changed the title enhancement: async dynamic generator actions enh: async dynamic generator actions Apr 21, 2024
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