You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const session =Session.server({ protocol, provide: Api });
110
110
```
111
111
112
-
For now don't worry about the different modes and just focus on the data format. In this case we are telling Transporter that our API only uses JSON data types. With strict type checking enabled we get a type error.
112
+
For now don't worry about the different modes and just focus on the data type. In this case we are telling Transporter that our API only uses JSON data types. With strict type checking enabled we get a type error.
113
113
114
114
```
115
115
Type 'undefined' is not assignable to type 'Json'.
@@ -121,8 +121,8 @@ Can you spot the problem? If you can't then don't worry because the compiler spo
121
121
- import * as Json from "@daniel-nagy/transporter/Json";
122
122
+ import * as SuperJson from "@daniel-nagy/transporter/SuperJson";
123
123
124
-
-protocol: Subprotocol.Protocol<Json.t>(),
125
-
+protocol: Subprotocol.Protocol<SuperJson.t>(),
124
+
-dataType: Subprotocol.DataType<Json.t>(),
125
+
+dataType: Subprotocol.DataType<SuperJson.t>(),
126
126
```
127
127
128
128
With that change the error will go away.
@@ -140,14 +140,14 @@ import type { Api } from "./Server";
@@ -271,4 +271,3 @@ This example uses the `BrowserServer` API to communicate with a service worker.
271
271
This example renders a webview with a button to scan a barcode. When the button is tapped it will use the `BarCodeScanner` component from Expo to access the camera to scan a barcode. Because this example uses the camera you will need to run it on a real device. I just use the Expo Go app on my phone.
272
272
273
273
Transporter does not currently offer any React Native specific APIs. However, I may add React Native specific APIs similar to the browser APIs. It's just that React Native can be..._time consuming_.
0 commit comments