How to use the @nozbe/watermelondb/DatabaseProvider.withDatabase function in @nozbe/watermelondb

To help you get started, we’ve selected a few @nozbe/watermelondb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github status-im / liquid-funding / src / components / projects / Projects.jsx View on Github external
{project.manifest.avatar &amp;&amp; <img height="{40}/" width="{40}" src="{project.manifest.avatar}" alt="avatar">}
            
          
        
        
          
            <button color="primary" size="small">
              Read more
            </button>
          
        
      
    )
}

const ProjectCard = withDatabase(withObservables(['project'], ({ database, project }) =&gt; ({
  pledges: database.collections.get('pledges').query(
    Q.where('intended_project', project.projectId)
  ).observe()
}))(RawProjectCard))

function GridView({classes, projects, favorites, setFavorites}) {
  return (
    {projects.map((project, index) =&gt; {
      if (!project.manifest) {
        return ''
      }
      return (
        
      );
    })}