Is there a way to pass data between modules in a Forge app without using Storage API?

Or, if possible, is there a faster way of retreiving storage values?

I have a ProjectSettingsPage module that contains a Form, that should set a PortalHeader and PortalSubheader text to display in our Jira Service Management portal. As of now, it passes this Form data to storage with an onSubmit, as well as a Show/Hide message function:

storage.set("topMessage", form.topmsg)
storage.set("subMessage", form.submsg)

const displayMessage = async () => {
        storage.set("showMessage", true) };

Then, when I need to retrieve that data, I run these functions for the PortalHeader module:

const [showMessage] = useState(
        async () => await storage.get("showMessage"));
const [topMessage] = useState(
        async () => await storage.get("topMessage"));

Fetching these values from Storage to display for users in the portal requires a 1-3 second load every time the user loads the portal, as well as clicking on any request type. The load breaks the formatting of the portal pages until the API request is completed and the message is retrieved, which causes UI issues for the end users.

Is there a way to set these values to something not using the Storage API, or to a txt/CSV file within the app that does not cause the page load to be too slow to be usable?

Thanks.

2 Likes