JSPM

cem-plugin-async-function

0.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 410
  • Score
    100M100P100Q88370F
  • License MIT

async flag for functions and class methods

Package Exports

  • cem-plugin-async-function
  • cem-plugin-async-function/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cem-plugin-async-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cem-plugin-async-function

Adds (non-standard) "async" flag to functions and class methods

Example

custom-elements-manifest.config.js

import { asyncFunctionPlugin } from 'cem-plugin-async-function';

export default {
  plugins: [
    asyncFunctionPlugin(),
  ]
}

async-function.ts

/** @element async-method */
export class Async {
  async a() {}
}

export async function b() {}

Output

{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "async-function.js",
      "declarations": [
        {
          "kind": "class",
          "description": "",
          "name": "Async",
          "members": [
            {
              "kind": "method",
              "name": "a",
              "async": true
            }
          ],
          "tagName": "async-method",
          "customElement": true
        },
        {
          "kind": "function",
          "name": "b",
          "async": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "Async",
          "declaration": {
            "name": "Async",
            "module": "async-function.js"
          }
        },
        {
          "kind": "js",
          "name": "b",
          "declaration": {
            "name": "b",
            "module": "async-function.js"
          }
        }
      ]
    }
  ]
}