Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Duncalf committed May 5, 2022
1 parent d5d1010 commit b4f3323
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 50 deletions.
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
],
"eslint.format.enable": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
Expand All @@ -18,6 +18,5 @@
"gitlens.advanced.blame.customArguments": [
"--ignore-revs-file",
".gitignore-revs"
],
"C_Cpp.dimInactiveRegions": false
]
}
54 changes: 8 additions & 46 deletions example/app/AppWrapperNonSync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,17 @@ import {TaskRealmContext} from './models';
import colors from './styles/colors';
import {AppNonSync} from './AppNonSync';

import Realm from 'realm';

export const AppWrapperNonSync = () => {
// const {RealmProvider} = TaskRealmContext;

const go = async () => {
taskSchema = {
name: 'Task',
primaryKey: '_id',
properties: {
_id: 'objectId',
description: 'string',
isComplete: {type: 'bool', default: false},
createdAt: 'date',
userId: 'string',
},
};

app = new Realm.App({id: 'application-0-ppxve'});

user = await app.logIn(Realm.Credentials.anonymous());

realm = await Realm.open({
sync: {
user,
flexible: true,
initialSubscriptions: {
updateCallback: (m, r) => {
m.add(r.objects('Task'));;
},,
},,
},
onFirstOpen: () => {
console.log('onfirstopen ');
},
});

console.log('done', realm);;

console.log(realm.objects('Task'));;

// setTimeout(()=>{
// realm.cancel()}, 1000);
};

go();
const {RealmProvider} = TaskRealmContext;

// If sync is disabled, setup the app without any sync functionality and return early
return <SafeAreaView style={styles.screen}></SafeAreaView>;
return (
<SafeAreaView style={styles.screen}>
<RealmProvider>
<AppNonSync />
</RealmProvider>
</SafeAreaView>
);
};

const styles = StyleSheet.create({
Expand Down

0 comments on commit b4f3323

Please sign in to comment.