Skip to content

postgrelize / AfterCreate

Variable: AfterCreate ​

const AfterCreate: ModelStaticMethodDecorator

Defined in: src/decorators/hook-decorators.ts:77

Registers the decorated static method as an afterCreate hook of the model (like Model.afterCreate). The method receives the hook arguments; static methods only. Registered when sequelize.addModels applies the class. Accepts the TC39 and the legacy experimentalDecorators call signature.

Example ​

ts
class User extends Model {
  @AfterCreate
  static async onAfterCreate(user: User, options: unknown) {}
}

Released under the MIT License.