Skip to content

Commit fa14166

Browse files
author
Matthieu Gicquel
committed
remove unused code
1 parent fb0b70b commit fa14166

9 files changed

Lines changed: 7 additions & 144 deletions

File tree

android/src/main/java/tech/bam/rnas/RNASModule.kt

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,7 @@ import expo.modules.kotlin.modules.Module
44
import expo.modules.kotlin.modules.ModuleDefinition
55

66
class RNASModule : Module() {
7-
// Each module class must implement the definition function. The definition consists of components
8-
// that describes the module's functionality and behavior.
9-
// See https://docs.expo.dev/modules/module-api for more details about available components.
107
override fun definition() = ModuleDefinition {
11-
// Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
12-
// Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
13-
// The module will be accessible from `requireNativeModule('RNAS')` in JavaScript.
148
Name("RNAS")
15-
16-
// Sets constant properties on the module. Can take a dictionary or a closure that returns a dictionary.
17-
Constants(
18-
"PI" to Math.PI
19-
)
20-
21-
// Defines event names that the module can send to JavaScript.
22-
Events("onChange")
23-
24-
// Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
25-
Function("hello") {
26-
"Hello world! 👋"
27-
}
28-
29-
// Defines a JavaScript function that always returns a Promise and whose native code
30-
// is by default dispatched on the different thread than the JavaScript runtime runs on.
31-
AsyncFunction("setValueAsync") { value: String ->
32-
// Send an event to JavaScript.
33-
sendEvent("onChange", mapOf(
34-
"value" to value
35-
))
36-
}
37-
38-
// Enables the module to be used as a native view. Definition components that are accepted as part of
39-
// the view definition: Prop, Events.
40-
View(RNASView::class) {
41-
// Defines a setter for the `name` prop.
42-
Prop("name") { view: RNASView, prop: String ->
43-
println(prop)
44-
}
45-
}
469
}
4710
}

android/src/main/java/tech/bam/rnas/RNASView.kt

Lines changed: 0 additions & 7 deletions
This file was deleted.

example/App.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
import { StyleSheet, Text, View } from 'react-native';
2-
3-
import * as RNAS from '@bam.tech/react-native-app-security';
1+
import { StyleSheet, Text, View } from "react-native";
42

53
export default function App() {
64
return (
75
<View style={styles.container}>
8-
<Text>{RNAS.hello()}</Text>
6+
<Text>{"hello"}</Text>
97
</View>
108
);
119
}
1210

1311
const styles = StyleSheet.create({
1412
container: {
1513
flex: 1,
16-
backgroundColor: '#fff',
17-
alignItems: 'center',
18-
justifyContent: 'center',
14+
backgroundColor: "#fff",
15+
alignItems: "center",
16+
justifyContent: "center",
1917
},
2018
});

ios/RNASModule.swift

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
11
import ExpoModulesCore
22

33
public class RNASModule: Module {
4-
// Each module class must implement the definition function. The definition consists of components
5-
// that describes the module's functionality and behavior.
6-
// See https://docs.expo.dev/modules/module-api for more details about available components.
74
public func definition() -> ModuleDefinition {
8-
// Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
9-
// Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
10-
// The module will be accessible from `requireNativeModule('RNAS')` in JavaScript.
115
Name("RNAS")
12-
13-
// Sets constant properties on the module. Can take a dictionary or a closure that returns a dictionary.
14-
Constants([
15-
"PI": Double.pi
16-
])
17-
18-
// Defines event names that the module can send to JavaScript.
19-
Events("onChange")
20-
21-
// Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
22-
Function("hello") {
23-
return "Hello world! 👋"
24-
}
25-
26-
// Defines a JavaScript function that always returns a Promise and whose native code
27-
// is by default dispatched on the different thread than the JavaScript runtime runs on.
28-
AsyncFunction("setValueAsync") { (value: String) in
29-
// Send an event to JavaScript.
30-
self.sendEvent("onChange", [
31-
"value": value
32-
])
33-
}
34-
35-
// Enables the module to be used as a native view. Definition components that are accepted as part of the
36-
// view definition: Prop, Events.
37-
View(RNASView.self) {
38-
// Defines a setter for the `name` prop.
39-
Prop("name") { (view: RNASView, prop: String) in
40-
print(prop)
41-
}
42-
}
43-
}
446
}

ios/RNASView.swift

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/RNAS.types.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/RNASModule.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { requireNativeModule } from 'expo-modules-core';
1+
import { requireNativeModule } from "expo-modules-core";
22

3-
// It loads the native module object from the JSI or falls back to
4-
// the bridge module (from NativeModulesProxy) if the remote debugger is on.
5-
export default requireNativeModule('RNAS');
3+
export default requireNativeModule("RNAS");

src/RNASView.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)