This version of the documentation is outdated, and features documented here may work differently now. You can see the latest stable version of the docs here.
Control Actions
Control actions in Perseus can only be taken by one plugin, unlike functional actions, because, if multiple plugins took them, Perseus wouldn't know what to do. For example, if more than one plugin tried to replace the immutable store, Perseus wouldn't know which alternative to use.
Control actions can be considered more powerful than functional actions because they allow a plugin to not only extend, but to replace engine functionality.
List of Control Actions
Here's a list of all the control actions currently supported by Perseus, which will likely grow over time. You can see these in this file in the Perseus repository.
If you'd like to request that a new action, functional or control, be added, please open an issue.
Note: there are currently very few control actions, and this list will be expanded over time.
settings_actions
-- actions that can alter the settings provided by the user withPerseusApp
set_immutable_store
-- sets an alternative immutable store (e.g. to store data somewhere other than the filesystem for some reason)set_locales
-- sets the app's locales (e.g. to fetch locales from a database in a more convenient way)set_app_root
-- sets the HTMLid
of thediv
in which to render Perseus (e.g. to fetch the app root from some other service)
build_actions
-- actions that'll be run when the user runsperseus build
orperseus serve
as part of the build process (these will not be run in static exporting)export_actions
-- actions that'll be run when the user runsperseus export
server_actions
-- actions that'll be run as part of the Perseus server when the user runsperseus serve
(or when a serverful production deployment runs)client_actions
-- actions that'll run in the browser when the user's app is accessed