hook_controller 1.0.0 copy "hook_controller: ^1.0.0" to clipboard
hook_controller: ^1.0.0 copied to clipboard

outdated

Simple hooks system

HookController #

Simple hooks system

Usage #

A simple usage example:

import 'package:hook_controller/hook_controller.dart';

void main() async {
  final beforeSendHook = HookController<String>();

  // salt password
  beforeSendHook.registerHook((password, next) => next('salt $password salt'));

  // hash password
  beforeSendHook.registerHook((password, next) => next('hash $password hash'));

  final String password = 'my_password';

  final hashedPassword = await beforeSendHook.execute(password);
  print(
    'Hashed password is \'$hashedPassword\'.',
  ); // Hashed password is 'hash salt my_password salt hash'.
}

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Simple hooks system

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on hook_controller