Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatusiak authored Dec 24, 2023
1 parent 9ff6fea commit afa15a5
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions react-native-tutorials/GUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,30 @@ npm install @react-native-async-storage/async-storage #for gun storage

# step3: loading gun (App.js)
```js
import PolyfillCrypto from 'react-native-webview-crypto'
import React, {useRef} from 'react';
import PolyfillCrypto from 'react-native-webview-crypto';
import 'react-native-get-random-values';
import GUN from 'gun/src'
import SEA from 'gun/sea'
import 'gun/lib/radix.js'
import 'gun/lib/radisk.js'
import 'gun/lib/store.js'
import Gun from 'gun/src';
import 'gun/sea';
import 'gun/lib/radix.js';
import 'gun/lib/radisk.js';
import 'gun/lib/store.js';
import AsyncStorage from '@react-native-async-storage/async-storage';
import asyncStore from 'gun/lib/ras.js'
```
import asyncStore from 'gun/lib/ras.js';

export default function App() {
var gun = useRef(null);
if (gun.current == null) {
gun.current = Gun({
peers: 'https://gun:8765/gun',
store: asyncStore({AsyncStorage}),
});
}
return (
<>
<PolyfillCrypto />
</>
);
}

```js
var gun = Gun({
peers: "https://gun:8765/gun",
store: asyncStore({ AsyncStorage })
});
```

0 comments on commit afa15a5

Please sign in to comment.