Install project dependencies with yarn
:
yarn install
Install project pependencies with npm
:
npm install
Build only project components for production
Start webpack build with watcher.
Updating npm version.
Publish valiot-framework to npm.
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>
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>
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