npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@x10.software/react-native-meteor-offline

v2.2.7

Published

Link react-native-meteor to redux

Downloads

3

Readme

react-native-meteor-offline

This package uses redux and redux-persist behind the scenes to maintain offline versions of your meteor data (compatible with react-native-meteor).

Important: V 2.0 implements a new class-based API. The V 1 api will be deprecated at some point. I've also renamed this react-native-meteor-offline, since that's more reflective of what it is. Access the 1.X API here: https://github.com/DesignmanIO/react-native-meteor-redux/tree/1.1.1

Install

npm install react-native-meteor-redux

Use

Initialize

import MeteorOffline from 'react-native-meteor-redux';

// initialize a MeteorOffline instance with options, currently just takes debounce
// Do this at/near the top level of your app
const GroundedMeteor = new MeteorOffline({debounce: 1000});

// Now you can access MeteorStore as a redux store throughout your app.
export {GroundedMeteor};

Using cached collection

import {GroundedMeteor} from '../index';
import Meteor, {createContainer} from 'react-native-meteor';

const component = (props) => {
  const {docs} = props;
  return (
    <View>
      {
        docs.map((doc) => {
          <Text>{doc.title}, </Text>
        });
      }
    </View>
  )
}

export createContainer((props) => {
  // MeteorOffline.subscribe takes an extra first parameter, uniqueSubscriptionName
  // The unique name allows you to have multiple subscriptions to the same publication
  // Collections are synchronized based on the uniqueSubscriptionName
  const sub = GroundedMeteor.subscribe('getUsersById', 'users/id', {userIds: [...]}, () => {
    console.log('callback');
  });
  // MeteorOffline.collection works as normal, but we pass the unique subscription name so that behind the scenes it will synchronize your collection
  return {
    docs: GroundedMeteor.collection('docs', 'getUsersById').find({}),
  };
}, component)

Running the example

Execute the following commands:

cd example/RNApp && npm i
cd ../MeteorApp && meteor
cd ../RNApp && react-native run-ios
# or
cd ../RNApp && react-native run-android

If you get .babelrc errors, try running this in the RNApp directory

./node_modules/react-native/packager/packager.sh start --reset-cache