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

dreamwalk-react-native-template

v0.3.0

Published

DreamWalk React Native Template

Downloads

6

Readme

Dreamwalk React-Native Template

Build Environements

Dev

  • Attached to dev backend, used for local development and pushing to DreamWalk Beta platform for internal builds
  • Reads from .env.development env file

UAT

  • Attached to UAT backend, used for pushing to DreamWalk Beta platform
  • Reads from .env.uat env file

Production

  • Attached to Production backend, used for pushing to App Store/Play Store.
  • Using clients Apple Developer account/Google Play production keystore
  • Reads from .env.production env file

Loading & Error Reducers

This template utilizes loading and error reducers to assist with decluttering your redux stores with loading and error states. To leverage this functionality your redux action types MUST be defined in a strict format: Each action that contains a network call or has the potential to fail will be given a base value, for this example we'll call it EXAMPLE_ACTION

EXAMPLE_ACTION must have 3 accompanying action types created with a different post-fix: _REQUEST to be dispatched when the action creator is first called _SUCCESS to be dispatched after successful completion of async network call or some other function _FAILURE to be dispatched on error.

Here's an example usage of this action types within an async network call

const FOO_BASE = 'FOO'
const FOO_REQUEST = 'FOO_REQUEST'
const FOO_SUCCESS = 'FOO_SUCCESS'
const FOO_FAILURE = 'FOO_FAILURE'

export const foo = () => async (dispatch, getState) => {
  try {
    dispatch({ type: FOO_REQUEST });

    const { data } = await axios.get('/bar');

    dispatch({
      type: FOO_SUCCESS,
      payload: { ...data },
    });
  } catch (error) {
    dispatch({ type: FOO_FAILURE, payload: error });
  }
};

To subscribe to loading and error events for our function we will create selectors on our components to want to listen to this action creator execution. We import our loading and error selector generating functions from LoadingReducer and ErrorReducer respectively.

import React from 'react';
import { View } from 'react-native';

import { createLoadingSelector } from '/path/to/LoadingReducer';
import { createErrorSelector } from '/path/to/ErrorReducer';
import {FOO_BASE} from '/path/to/actions';

const fooLoadingSelector = createLoadingSelector([FOO_BASE])
const fooErrorsSelector = createErrorSelector([FOO_BASE])

const FooBar = ({ navigation, route }) => {
    const loadingFoo = useSelector(state => fooLoadingSelector(state))
    const fooErrors = useSelector(state => fooErrorsSelector(state))
  
    <View>
      {
          ...
      }
    </View>
  );
};

export default FooBar;

Now that we've created selectors to the loading and error states of this function call we can use this to update the UI of the component as necessary. Selectors that are created with createErrorSelector will return errors as an array, and will always return a string value of the error that occured, as such they can be rendered like so:

<View>
  {fooErrors && <Text>fooErrors?.[0]</Text>}
</View>