← @mortar-kit/core

islandActionsfunction

import { islandActions } from '@mortar-kit/core'

function islandActions(options: IslandActionsOptions): BrickActions

BrickActions for islands (interactive bricks on pages without the router): a form post calls run in the background and only its brick updates, pending until the result (or error) is back. Pass it to hydrateIslands.

Parameters

Returns

BrickActions

Example

// src/islands.ts; runBrickAction is the "use server" function brickActions posts to.
hydrateIslands({ bricks, actions: islandActions({ action: brickActions.action, run: runBrickAction }) });