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
So, here's where i'm at - most definitely confused, probably being an idiot as well.
So I'm switching from redux to Watermelon to make the app offline first. I am using an expo configuration and have checked all data is functional in the redux version, as well as console logging the data in question.
Based on #104, I assume that something is wrong somewhere in my babel, but I'm not experienced enough to recognise where this issue is, hopefully, someone out there can help.
(I believe my writer functions are working, just cant seem to create the object initially)
Some code now:
hooks/user-context.ts
This attempts to implement a context which can be passed down all components as the user shouldn't change, but some of the fields might. If you can also help clean this up I would be greatful. I want to make user accessible accross the app and would rather not use a HOC unless I absolutely have to.
Authentication.tsx
This component uses AuthSession to get a token and user information from our authentication server, This then passes the token and auth information to the create function which has been defined as in the following `model/user.ts`
importLokiJSAdapterfrom'@nozbe/watermelondb/adapters/lokijs'importschemafrom'./schema'importmigrationsfrom'./migrations'exportconstadapter=newLokiJSAdapter({// carbon copy from install guide :)})
database/index.ts
import{Database}from'@nozbe/watermelondb'importUserfrom'../models/user'import{adapter}from'./adapter'// Then, make a Watermelon database from it!exportconstdatabase=newDatabase({
adapter,modelClasses: [User,],})
constcreateExpoWebpackConfigAsync=require('@expo/webpack-config')module.exports=asyncfunction(env,argv){try{constconfig=awaitcreateExpoWebpackConfigAsync({
...env,babel: {dangerouslyAddModulePathsToTranspile: [// Ensure that all packages starting with @tensorflow are// transpiled.'@tensorflow',],},},argv)// Customize the config before returning it.// resolve victory-native as victory for the Web appconfig.resolve.alias['victory-native']='victory'config.resolve.alias['react-native-maps']='react-native-web-maps'returnconfig}catch{return}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So, here's where i'm at - most definitely confused, probably being an idiot as well.
So I'm switching from redux to Watermelon to make the app offline first. I am using an expo configuration and have checked all data is functional in the redux version, as well as console logging the data in question.
Based on #104, I assume that something is wrong somewhere in my babel, but I'm not experienced enough to recognise where this issue is, hopefully, someone out there can help.
(I believe my writer functions are working, just cant seem to create the object initially)
Some code now:
hooks/user-context.ts
This attempts to implement a context which can be passed down all components as the user shouldn't change, but some of the fields might. If you can also help clean this up I would be greatful. I want to make user accessible accross the app and would rather not use a HOC unless I absolutely have to.Authentication.tsx
This component uses AuthSession to get a token and user information from our authentication server, This then passes the token and auth information to the create function which has been defined as in the following `model/user.ts`model/user.ts
database/adapter.web.ts
database/index.ts
babel.config.js
webpack.config.js
Beta Was this translation helpful? Give feedback.
All reactions