once method

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

Apply the callback function once without subscribing to changes.

Implementation

Gun once(Function(dynamic data, String key) cb) {
  final gun = _gun.once(allowInterop(
    (dynamic data, key) {
      cb(jsToDart(data), key);
    },
  ));
  return Gun._(gun);
}