Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Aral Balkan (aral@mastodon.ar.al)'s status on Wednesday, 09-Aug-2023 14:02:52 UTC Aral Balkan Aral Balkan

    A little #JSDoc tip:

    If you need to use a type definition in an external file multiple times, you don’t have to keep writing `import(…).type` over and over. Just create a new type definition in your local file and use that.

    e.g.,

    ```js
    /** @typedef {import('./SetupState.js').SetupStateType} SetupStateType */

    const state = {
    domain: /** @type SetupStateType */ (new SetupState('Domain')),
    server: /** @type SetupStateType */ (new SetupState('Server')),
    …
    }
    ```

    #js #web #dev

    In conversation Wednesday, 09-Aug-2023 14:02:52 UTC from mastodon.ar.al permalink

    Feeds

    • Activity Streams
    • RSS 2.0
    • Atom
    • Help
    • About
    • FAQ
    • Privacy
    • Source
    • Version
    • Contact

    Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

    Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.