use-subscription.js 449 B

12345678910111213141516171819
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow strict
  8. * @format
  9. * @nolint
  10. */
  11. 'use strict';
  12. declare module 'use-subscription' {
  13. declare export function useSubscription<Value>(subscription: {|
  14. getCurrentValue: () => Value,
  15. subscribe: (callback: Function) => () => void,
  16. |}): Value;
  17. }