File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed
Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 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-local
8+ * @format
9+ */
10+ 'use strict' ;
11+
12+ import type { TurboModule } from 'RCTExport' ;
13+ import * as TurboModuleRegistry from 'TurboModuleRegistry' ;
14+
15+ export interface Spec extends TurboModule {
16+ + fetchSegment : (
17+ segmentId : number ,
18+ options : Object , // flowlint-line unclear-type: off
19+ callback : ( error : ?Object ) = > void , // flowlint-line unclear-type: off
20+ ) = > void ;
21+ }
22+
23+ export default TurboModuleRegistry . getEnforcing < Spec > ( 'SegmentFetcher' ) ;
Original file line number Diff line number Diff line change @@ -18,14 +18,7 @@ global.__fetchSegment = function(
1818 options : { | + otaBuildNumber : ?string | } ,
1919 callback : ( ?Error ) = > void ,
2020) {
21- const { SegmentFetcher} = require ( 'NativeModules' ) ;
22- if ( ! SegmentFetcher ) {
23- throw new Error (
24- 'SegmentFetcher is missing. Please ensure that it is ' +
25- 'included as a NativeModule.' ,
26- ) ;
27- }
28-
21+ const SegmentFetcher = require ( 'NativeSegmentFetcher' ) . default ;
2922 SegmentFetcher . fetchSegment (
3023 segmentId ,
3124 options ,
You can’t perform that action at this time.
0 commit comments