LogoRobo.js
Framework

prioritizeHookBefore()

Function: prioritizeHookBefore()

function prioritizeHookBefore(
   hookType, 
   pluginName, 
   beforePlugin): void

Set a plugin's hook to run before another plugin's hook. Adjusts the priority to be 10 less than the target plugin's priority.

Parameters

ParameterTypeDescription
hookTypeLifecycleHookTypeThe lifecycle hook type
pluginNamestringThe plugin to prioritize
beforePluginstringThe plugin that should run after

Returns

void

Example

import { prioritizeHookBefore } from 'robo.js'

// Ensure server starts before discordjs
prioritizeHookBefore('start', '@robojs/server', '@robojs/discordjs')

On this page