{"_id":"@dreamwalk-os/dreamwalk-react-native-template","_rev":"6-e983d1fa10788e6df023a8b962cc5b09","name":"@dreamwalk-os/dreamwalk-react-native-template","dist-tags":{"latest":"0.4.0"},"versions":{"0.4.0":{"name":"@dreamwalk-os/dreamwalk-react-native-template","version":"0.4.0","author":{"name":"Bryce Pavey","email":"bryce@dreamwalk.com.au"},"license":"MIT","_id":"@dreamwalk-os/dreamwalk-react-native-template@0.4.0","maintainers":[{"name":"dreamwalk","email":"systems@dreamwalk.com.au"},{"name":"brycepavey","email":"bryce@dreamwalk.com.au"}],"homepage":"https://gitlab.com/dreamwalk/magic-button/react-native-redux-template#readme","bugs":{"url":"https://gitlab.com/dreamwalk/magic-button/react-native-redux-template/issues"},"dist":{"shasum":"492b96940c93327472c29905e2032eea3e1ad215","tarball":"https://registry.npmjs.org/@dreamwalk-os/dreamwalk-react-native-template/-/dreamwalk-react-native-template-0.4.0.tgz","fileCount":133,"integrity":"sha512-IQayunVDN4klq0dArgoFKIZl29d9Xw4Wk9wa2gaRYlOqICPux3oAkjHVmsivIlNlknksiqZO/BS7sR4W64RaRA==","signatures":[{"sig":"MEUCIQDWXYC0snwTd+UDC3RSof9WPms2LgTFfT7x3/bUgQGO+AIgb+uVpIFw/Yao0lQHvfbFTou65Ubru+6WlciatOyske8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOYHZCRA9TVsSAnZWagAAiF0P/2R/yBgoC2C8awYe0bxD\ny1yvLYCapircFZ+jzHXBOzIXDPrmBMa7x1r5FJ+d6Ur1OPGivY8ql3hDZang\nJ886EWjLX2PL31qBLG+PyZCgtOUmeZj15vDjdGyHBYwYz7fep4l6PuGNUIHR\nIWKOobI9vU3zuMxeL6BhuQFnW5HpBUMgHk7Cl5VIVQJQJhWI3gEGv2/OwWeZ\nra9bBDC+jPHnr5hZMhiYS7oCvW724+HPg0A5W0POK1oh55m6ZCShJUaNpiER\nawD7EqR8gKdpx2J477ShG9dc5ACICphoOcA34hqmR7sKEgvRac1CYOWLfnpD\nYQEIwEhXyxNvFCdAjJGTBLLKcv0Hmi1NR17FSdv9Foq4f2nzWpTYSD1toGYe\n7DKVT+Yfg89k39YU4hyHK+mk6puWLNv+nbq0xhgTSPQSGRND0LSBmf9D9Ckj\ntE9JBQyZ9EThvZS8KSTH4N8WJpaMEumYxYDAjtWMMMrLCllI1EQOpIxFIZxc\nTKUfudDbsqigLrOnatKv3+k+mbAqqxkw1mIJpwqzAUi071zjzhr2E6ZKBE0z\nXyBEHsGraRFvISAQf89u8YAlNjoaMK3UQePWKr9AOekADrPhh44FTiN4BI2r\nyIzfUNq3FETvaOiPlJzED48Xzva5+C2V+Bqsgy08MRAUv+kLlCPgBqHV+39I\n8wIq\r\n=J/qR\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"398f62106d12a6e333f145c31e71b03f8fb984d1","_npmUser":{"name":"brycepavey","email":"bryce@dreamwalk.com.au"},"repository":{"url":"git+https://gitlab.com/dreamwalk/magic-button/react-native-redux-template.git","type":"git"},"_npmVersion":"6.14.11","description":"DreamWalk React Native Redux Template","directories":{},"_nodeVersion":"14.16.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dreamwalk-react-native-template_0.4.0_1631158745528_0.767266768822928","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-09-09T03:39:05.453Z","modified":"2025-10-07T02:01:04.424Z","0.4.0":"2021-09-09T03:39:05.797Z"},"bugs":{"url":"https://gitlab.com/dreamwalk/magic-button/react-native-redux-template/issues"},"author":{"name":"Bryce Pavey","email":"bryce@dreamwalk.com.au"},"license":"MIT","homepage":"https://gitlab.com/dreamwalk/magic-button/react-native-redux-template#readme","repository":{"url":"git+https://gitlab.com/dreamwalk/magic-button/react-native-redux-template.git","type":"git"},"description":"DreamWalk React Native Redux Template","maintainers":[{"email":"systems@dreamwalk.com.au","name":"dreamwalk-apps"},{"email":"operations@dreamwalk.com.au","name":"dreamwalk-apps-admin"},{"email":"jdm0096@gmail.com","name":"jmargenberg"},{"email":"bryce@dreamwalk.com.au","name":"brycepavey"}],"readme":"# Dreamwalk React-Native Template\n\n## Build Environements\n\n### Dev\n\n-   Attached to dev backend, used for local development and pushing to DreamWalk Beta platform for internal builds\n-   Reads from .env.development env file\n\n### UAT\n\n-   Attached to UAT backend, used for pushing to DreamWalk Beta platform\n-   Reads from .env.uat env file\n\n### Production\n\n-   Attached to Production backend, used for pushing to App Store/Play Store.\n-   Using clients Apple Developer account/Google Play production keystore\n-   Reads from .env.production env file\n\n\n## Loading & Error Reducers\n\nThis template utilizes loading and error reducers to assist with decluttering your\nredux stores with loading and error states.\nTo leverage this functionality your redux action types MUST be defined in a strict format:\nEach 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`\n\n`EXAMPLE_ACTION` must have 3 accompanying action types created with a different post-fix: \n`_REQUEST` to be dispatched when the action creator is first called\n`_SUCCESS` to be dispatched after successful completion of async network call or some other function\n`_FAILURE` to be dispatched on error.\n\nHere's an example usage of this action types within an async network call\n\n```\nconst FOO_BASE = 'FOO'\nconst FOO_REQUEST = 'FOO_REQUEST'\nconst FOO_SUCCESS = 'FOO_SUCCESS'\nconst FOO_FAILURE = 'FOO_FAILURE'\n\nexport const foo = () => async (dispatch, getState) => {\n  try {\n    dispatch({ type: FOO_REQUEST });\n\n    const { data } = await axios.get('/bar');\n\n    dispatch({\n      type: FOO_SUCCESS,\n      payload: { ...data },\n    });\n  } catch (error) {\n    dispatch({ type: FOO_FAILURE, payload: error });\n  }\n};\n```\n\nTo 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.\nWe import our loading and error selector generating functions from `LoadingReducer` and `ErrorReducer` respectively.\n\n```\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { createLoadingSelector } from '/path/to/LoadingReducer';\nimport { createErrorSelector } from '/path/to/ErrorReducer';\nimport {FOO_BASE} from '/path/to/actions';\n\nconst fooLoadingSelector = createLoadingSelector([FOO_BASE])\nconst fooErrorsSelector = createErrorSelector([FOO_BASE])\n\nconst FooBar = ({ navigation, route }) => {\n    const loadingFoo = useSelector(state => fooLoadingSelector(state))\n    const fooErrors = useSelector(state => fooErrorsSelector(state))\n  \n    <View>\n      {\n          ...\n      }\n    </View>\n  );\n};\n\nexport default FooBar;\n\n```\n\nNow 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. \nSelectors 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:\n\n```\n<View>\n  {fooErrors && <Text>fooErrors?.[0]</Text>}\n</View>\n```\n","readmeFilename":"README.md"}