0.1.21 • Published 6 years ago

traversal-react-redux v0.1.21

Weekly downloads
82
License
-
Repository
github
Last release
6 years ago

React components and redux tools for use with the Traversal Engine API

Installation

DoctorLink's Traversal Client Tools are available as an npm package.

npm install @doctorlink/traversal-react-redux

Contents

SectionDescription
ComponentsAll of the components used in the library
Component ModulesComponents combined in useful ways
ThemingCreating custom themes
Redux ReducersDefining/updating the store
ActionsActions to be dispatched to the store
ContainersComponents bound to state/actions
SagasSagas to handle state side-effects
ServicesServices for making api calls
StoreComplete Redux-Saga Stores
SamplesSamples of how this library can be used

Usage

Here is a quick example to get you started, it's all you need:

import React from 'react';
import { render } from 'react-dom';
import { TraversalStore, TraversalApp } from '@doctorlink/traversal-react-redux';

//Token requested from POST https://prod-platform-identity.doctorlink.engineering/connect/token
const bearerToken = 'TOKEN';
const productId = 1;
const traversalEngineApi = 'https://prod-platform-traversal-engine.doctorlink.engineering';

const traversalStore = new TraversalStore(traversalEngineApi);

traversalStore.store.dispatch(traversalStart({productId}));
traversalStore.setToken(bearerToken)

render(<TraversalApp store={traversalStore.store} />, document.getElementById('root'));

Development

For ease of development, use npm link to point your client app to this library. You can then run npm start to compile your code on save, and your changes should be picked up immediately by your client app. For example:

cd TraversalReactRedux
npm link
cd ../TraversalEngineAPI/services/traversalclient/ClientApp/
npm link @doctorlink/traversal-react-redux

# In another console:
cd TraversalReactRedux
npm start

If you get an error about duplicate versions of react and/or react-dom ("Hooks can only be called inside the body of a function component"), try pointing this library to the versions used by your app:

npm link ../TraversalEngineAPI/services/traversalclient/ClientApp/node_modules/react
npm link ../TraversalEngineAPI/services/traversalclient/ClientApp/node_modules/react-dom

Note that react and react-dom are required both as peerDependencies and devDependencies; the latter is because they are required by the unit tests.

Publish

To publish the library run the AZDO publish pipeline. By default this will publish a patch release and update the latest tag in npm, but both of these options can be overriden in the variables tab.

Version can be one of the following: patch | minor | major | prepatch | preminor | premajor | prerelease

Tag can be overriden for other streams: latest | beta | next | staging

0.1.21

6 years ago

0.1.20

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago