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

Improve actions type #7012

Merged
merged 2 commits into from
Jul 2, 2019
Merged

Commits on Jun 8, 2019

  1. Improve actions type

    If they need to be expanded, the `ActionsFunction` overloads can be
    generated with the following code:
    
    ```js
    function buildActionsFactoryOverloads(numParams) {
      const overloads = [];
    
      for (let n = 0; n < numParams; n++) {
        const handlerParams = [];
        for (let i = 1; i <= n + 1; i++) {
          handlerParams.push(`handler${i}: T`);
        }
        overloads.push(
          `<T extends string>(${handlerParams.join(
            ', ',
          )}, options?: ActionOptions): ActionsMap<T>;`,
        );
      }
    
      return overloads.join('\n');
    }
    
    console.log(buildActionsFactoryOverloads(10));
    ```
    matt-tingen committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    1d28365 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2019

  1. Configuration menu
    Copy the full SHA
    bdb8f74 View commit details
    Browse the repository at this point in the history