processDecelerationRate.js 700 B

1234567891011121314151617181920212223242526272829303132
  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. * @format
  8. * @flow strict-local
  9. */
  10. 'use strict';
  11. const Platform = require('../../Utilities/Platform');
  12. function processDecelerationRate(
  13. decelerationRate: number | 'normal' | 'fast',
  14. ): number {
  15. if (decelerationRate === 'normal') {
  16. return Platform.select({
  17. ios: 0.998,
  18. android: 0.985,
  19. });
  20. } else if (decelerationRate === 'fast') {
  21. return Platform.select({
  22. ios: 0.99,
  23. android: 0.9,
  24. });
  25. }
  26. return decelerationRate;
  27. }
  28. module.exports = processDecelerationRate;