mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Change the js signature to be Promise based and dynamically detect it used as a callback
Summary: Making the default people see when they look at the module the Promise based version public Reviewed By: davidaurelio Differential Revision: D2850048 fb-gh-sync-id: e0815983ed798c202047cb071e65ce63a52fd1af
This commit is contained in:
committed by
facebook-github-bot-7
parent
c888e6583f
commit
747be0bf5c
@@ -23,10 +23,10 @@ module.exports = {
|
||||
* var content = await Clipboard.getString();
|
||||
* }
|
||||
* ```
|
||||
* @param this parameter is deprecated. callback is function with one argument of string type
|
||||
*/
|
||||
getString(callback) {
|
||||
if (callback) {
|
||||
getString() {
|
||||
if (arguments.length > 0) {
|
||||
let callback = arguments[0];
|
||||
console.warn('Clipboard.getString(callback) is deprecated. Use the returned Promise instead');
|
||||
Clipboard.getString().then(callback);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user