question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Realm Database with Redux

See original GitHub issue

Goals

In fact, I’m building a react native application and i’m using Realm as database and also I’m using redux to manage state, but I find a problem when I pass realm object through reducers my application goes slow.

Expected Results

Getting and parsing data

Actual Results

Slower navigation of react native application

Code Sample

  let users = realm.objects("User");
  dispatch({
            type: FETCH_SEARCH_USERS_GLOBAL,
            payload: users
   })

Version of Realm and Tooling

  • Realm JS SDK Version: 2.16.0
  • React Native: 0.57
  • Client OS & Version: macOS 10.14.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
reyalpsirccommented, Mar 7, 2019

@benhartouz I’m also using Realm and Redux on projects and in my case, I use the thunks/sagas to write API responses to the Realm database only and, on the Containers, I just make the queries to the Realm database and make them listen for live changes. With this behavior, I only use Redux for stuff that I don’t need to store on device and which is shared along different Containers.

1reaction
benhartouzcommented, Dec 13, 2018

@ivanpagac thanks for your comment, in fact, I passed it through redux-thunk. what do you mean by v raw objects?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Realm with redux - MongoDB Atlas App Services & Realm
I would highly recommend against putting realm collections and/or items in a redux store, as Realm objects are self-mutating objects, and ...
Read more >
How to handle states with redux and realm [react-natve]
1 Answer 1 · Redux is state management library and Realm is just database solution. I guess you are trying to say redux...
Read more >
lolatravel/realm-react-redux - GitHub
In redux you have a reducer that takes the current state and an action which it processes to return a new state. In...
Read more >
Realm vs Redux Persist | What are the differences?
Realm is reactive, concurrent, and lightweight, allowing you to work with live, native objects; Redux Persist: A library to persist and rehydrate a...
Read more >
React native, Redux,Redux-thunk realm and redux persist
Redux persist makes it easy to store the state of redux store.However,as the applications complexity increases, we may require a database to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found