once method

User once(
  1. dynamic cb(
    1. dynamic data,
    2. String key
    )
)

Apply the callback function once without subscribing to changes.

Implementation

User once(Function(dynamic data, String key) cb) {
  final user = _user.once(allowInterop(
    (dynamic data, key) {
      cb(jsToDart(data), key);
    },
  ));
  return User._(user);
}