What Code Can & Can't Be Shared Between AdonisJS & Inertia

In this lesson, we'll discuss what code we can and cannot share between AdonisJS and Inertia.

Published
Sep 06
Duration
3m 10s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

Join The Discussion! (4 Comments)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 1 month ago

    Just wondering what's the clean way (if possible) to have a function that can be reused in both inertia scope and adonisjs scope. For example Enum that created at `/app/enums/…ts`, how do I make it possible so I can call it from my inertiajs scope. For now, I alway copy it twice to put under inertia just so i can use it.

    1

    Please sign in or sign up for free to reply

    1. Commented 1 month ago

      Hi nonwiz! As we did with the service in this lesson, you can import and use enums directly inside your frontend. It'll then be bundled with the frontend code when you build it.

      1

      Please sign in or sign up for free to reply

      1. Commented 1 month ago

        Thank tom!

        1

        Please sign in or sign up for free to reply

        1. Commented 1 month ago

          Anytime, nonwiz!!

          1

          Please sign in or sign up for free to reply