From 04fba7900a3ac1a6b57c149b9ade3ed7e6547f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Haider=20Fors=C3=A9n?= Date: Fri, 23 Nov 2018 14:56:50 +0100 Subject: [PATCH] Corrects flow return type (#1703) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary Using `firebase.links().createShortLink()` returns a promise with a string wrapper object. As far as I can tell, there is no reason it can not be a string literal, witch (to me) seems more logical (it is also the return type of the underlying function call). ### Checklist - [x] Supports `Android` - [x] Supports `iOS` - [ ] `e2e` tests added or updated in [/tests/e2e/\*](/tests/e2e) - [ ] Updated the documentation in the [docs repo](https://github.com/invertase/react-native-firebase-docs) - **LINK TO DOCS PR HERE** - [x] Flow types updated - [ ] Typescript types updated ### Test Plan Tested locally, works for me. ### Release Plan [TYPES][ENHANCEMENT] [LINKS] - Corrects flow return type to string literal instead of string wrapper --- Think `react-native-firebase` is great? Please consider supporting the project with any of the below: - 👉 Donate via [Open Collective](https://opencollective.com/react-native-firebase/donate) - 👉 Follow [`React Native Firebase`](https://twitter.com/rnfirebase) and [`Invertase`](https://twitter.com/invertaseio) on Twitter - 👉 Star this repo on GitHub ⭐️ - 👉 Contribute; see our [contributing guide](/CONTRIBUTING.md) :fire: --- src/modules/links/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/links/index.js b/src/modules/links/index.js index cfbb55f5..cb2f3b23 100644 --- a/src/modules/links/index.js +++ b/src/modules/links/index.js @@ -47,7 +47,7 @@ export default class Links extends ModuleBase { /** * Create long Dynamic Link from parameters * @param parameters - * @returns {Promise.} + * @returns {Promise.} */ createDynamicLink(link: DynamicLink): Promise { if (!(link instanceof DynamicLink)) { @@ -67,12 +67,12 @@ export default class Links extends ModuleBase { /** * Create short Dynamic Link from parameters * @param parameters - * @returns {Promise.} + * @returns {Promise.} */ createShortDynamicLink( link: DynamicLink, type?: 'SHORT' | 'UNGUESSABLE' - ): Promise { + ): Promise { if (!(link instanceof DynamicLink)) { return Promise.reject( new Error( @@ -89,7 +89,7 @@ export default class Links extends ModuleBase { /** * Returns the link that triggered application open - * @returns {Promise.} + * @returns {Promise.} */ getInitialLink(): Promise { return getNativeModule(this).getInitialLink();