0.9.3 • Published 3 years ago

@cegal/ui-utils v0.9.3

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

UI

UI utilities we can use for our prokects

fetch

This is a fetch utility that can mock results, simulate different HTTP statues, and dispatches actions for request/success/failure events

How to use

import { fetch } from '@cegal/ui-utils'

and in your code, add this as an action:

const fetchSomething = (params) => {
  return fetch.call({
    url: YOUR_API_URL_HERE,
    expectedPayload: {
      'add here': 'your expected mocked response'
    },
    type: {
    request: 'YOUR_ACTION_FOR_REQUEST',
    success: 'YOUR_ACTION_FOR_SUCCESS',
    failure: 'YOUR_ACTION_FOR_FAILURE'
    }
  })
}

Note that this will return a Promise, so please use it in a Redux project with thunk middleware.

Change logs

Visit design.cegal.com/change-log

How to use it

install from npm.

npm install --save @cegal/ui-utils

See design.cegal.com on how to use the React components

License

Go to Licence

0.9.3

3 years ago

0.8.10

3 years ago

0.9.0

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago