valiot-utility-functions

2.0.2 • Public • Published

Getting Started

Install

Install project dependencies with yarn:

yarn install

Install project pependencies with npm:

npm install

Available Scripts

yarn build

Build only project components for production

yarn start

Start webpack build with watcher.

Updating a new npm version

npm version [major | minor | patch]

Updating npm version.

npm publish

Publish valiot-framework to npm.

Available Functions

Logout

To use the logout function, just import it at the beginning of your file:

import { logout } from 'valiot-utility-functions'

And use it as a normal function. Example:

<button onClick={() => logout()}>Logout</button>

Create Refresh Alert

To use the refreshAlert function, just import it at the beginning of your file:

import { refreshAlert } from 'valiot-utility-functions'

And use it as a normal function passing the link and the cache from the Apollo Client of your application, example:

<button onClick={() => refreshAlert(
  link,
  cache
)}>
  Logout
</button>

Create Alert

To use the createAlert function, just import it at the beginning of your file:

import { createAlert } from 'valiot-utility-functions'

And use it as a normal function passing the link and the cache as the first two parameters. The next parameters will be the following:

  • Title
  • Content
  • Context
  • Link
  • Link text

Example:

<button onClick={() => refreshAlert(
  link,
  cache,
  'Title',
  'Content',
  'INFO',
  'link',
  'linkText'
)}>
  Logout
</button>

Made by Valiot

Readme

Keywords

none

Package Sidebar

Install

npm i valiot-utility-functions

Weekly Downloads

0

Version

2.0.2

License

ISC

Unpacked Size

330 kB

Total Files

4

Last publish

Collaborators

  • acrogenesis
  • akacronos
  • barucalmaguer
  • lexot