Skip to content

Conversation

@benallfree
Copy link
Contributor

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
Contributor 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
Contributor 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
@benallfree benallfree requested a review from crutchcorn April 21, 2024 12:20
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