ComposedActions
ComposedActions<
TActions> =object
Defined in: packages/actions/src/types.ts:220
The result of combining multiple action definitions
via composeActions().
Provides a single action handler that dispatches by the _action discriminator,
a loader wrapper that checks permissions for all actions at once, a client
descriptor covering all action names, and the original action map.
Example
Section titled “Example”const composed = composeActions({ deletePost, publishPost, unpublishPost,});
export const action = composed.action;export const loader = composed.loader(myLoader);Type Parameters
Section titled “Type Parameters”TActions
Section titled “TActions”TActions extends Record<string, ActionDefinition<any, any, any>>
A record mapping action names to their ActionDefinition types.
Properties
Section titled “Properties”action()
Section titled “action()”action: (
args) =>Promise<unknown>
Defined in: packages/actions/src/types.ts:222
Combined action handler that dispatches to the correct action based on _action field.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<unknown>
actions
Section titled “actions”actions:
TActions
Defined in: packages/actions/src/types.ts:235
The original action definitions, keyed by name.
client
Section titled “client”client:
ClientDescriptor
Defined in: packages/actions/src/types.ts:233
Opaque descriptor covering all composed action names, for the useActions client hook.
loader()
Section titled “loader()”loader: <
TLoaderData>(loaderFn) => (args) =>Promise<TLoaderData&object>
Defined in: packages/actions/src/types.ts:229
Wraps a loader function to inject ActionPermissionsMap for all composed actions.
Checks permissions for every action in the map and merges the results
into loader data under _actionPermissions.
Type Parameters
Section titled “Type Parameters”TLoaderData
Section titled “TLoaderData”TLoaderData extends Record<string, Serializable>
Parameters
Section titled “Parameters”loaderFn
Section titled “loaderFn”(args) => Promise<TLoaderData>
Returns
Section titled “Returns”(
args):Promise<TLoaderData&object>
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TLoaderData & object>