在哪里设置React Native上的全局侦听器?

时间:2019-02-12 13:46:47

标签: reactjs react-native react-redux react-native-navigation

我知道这里是一个类似的问题(React Native - Global Event Listener),但是我的App.js本身不是组件,而是在其中使用组件和redux初始化Navigation(react-native-navigation)的地方。

我的问题是:如果我还不在任何组件内,如何从Bluetooth侦听器调用redux动作?

a:24:{s:2:"id";i:1436;s:4:"code";s:13:"stackoverflow";s:6:"amount";s:2:"35";s:12:"date_created";O:11:"WC_DateTime":4:{s:13:"*utc_offset";i:0;s:4:"date";s:26:"2019-02-04 11:43:31.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Australia/Sydney";}s:13:"date_modified";O:11:"WC_DateTime":4:{s:13:"*utc_offset";i:0;s:4:"date";s:26:"2019-02-04 11:43:31.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Australia/Sydney";}s:12:"date_expires";O:11:"WC_DateTime":4:{s:13:"*utc_offset";i:0;s:4:"date";s:26:"2019-06-30 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Australia/Sydney";}s:13:"discount_type";s:7:"percent";s:11:"description";s:0:"";s:11:"usage_count";i:0;s:14:"individual_use";b:0;s:11:"product_ids";a:0:{}s:20:"excluded_product_ids";a:0:{}s:11:"usage_limit";i:0;s:20:"usage_limit_per_user";i:1;s:22:"limit_usage_to_x_items";N;s:13:"free_shipping";b:0;s:18:"product_categories";a:0:{}s:27:"excluded_product_categories";a:0:{}s:18:"exclude_sale_items";b:0;s:14:"minimum_amount";s:0:"";s:14:"maximum_amount";s:0:"";s:18:"email_restrictions";a:0:{}s:7:"virtual";b:0;s:9:"meta_data";a:2:{i:0;O:12:"WC_Meta_Data":2:{s:15:"*current_data";a:3:{s:2:"id";i:20150;s:3:"key";s:20:"_wcs_number_payments";s:5:"value";s:0:"";}s:7:"*data";a:3:{s:2:"id";i:20150;s:3:"key";s:20:"_wcs_number_payments";s:5:"value";s:0:"";}}i:1;O:12:"WC_Meta_Data":2:{s:15:"*current_data";a:3:{s:2:"id";i:20151;s:3:"key";s:14:"slide_template";s:5:"value";s:7:"default";}s:7:"*data";a:3:{s:2:"id";i:20151;s:3:"key";s:14:"slide_template";s:5:"value";s:7:"default";}}}}

0 个答案:

没有答案