Skip to content

Commit 41d26a4

Browse files
committed
refactor: streamline AwesomeLibraryModule class definition and enhance module exports
1 parent 72d01fd commit 41d26a4

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

android/src/main/java/com/awesomelibrary/AwesomeLibraryModule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ package com.awesomelibrary
22

33
import com.facebook.react.bridge.ReactApplicationContext
44

5-
class AwesomeLibraryModule(reactContext: ReactApplicationContext) :
6-
NativeAwesomeLibrarySpec(reactContext) {
5+
class AwesomeLibraryModule(reactContext: ReactApplicationContext) : NativeAwesomeLibrarySpec(reactContext) {
76

87
override fun multiply(a: Double, b: Double): Double {
98
return a * b

ios/AwesomeLibrary.mm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#import "AwesomeLibrary.h"
22

3+
// core implementation of the AwesomeLibrary module
34
@implementation AwesomeLibrary
45
- (NSNumber *)multiply:(double)a b:(double)b {
56
NSNumber *result = @(a * b);
67

78
return result;
89
}
9-
10-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
11-
(const facebook::react::ObjCTurboModule::InitParams &)params
10+
// - (return_type)functionName:(param_type)param {
11+
// // implementation of the function with retrun type and parameters
12+
// }
13+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params
1214
{
1315
return std::make_shared<facebook::react::NativeAwesomeLibrarySpecJSI>(params);
1416
}

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { multiply } from './multiply';
2+
export { multiply as multiplyNative } from './multiply.native';

0 commit comments

Comments
 (0)