funckage
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

FUNCKAGE

FUNCTIONS (We all know what this is.) - KAGE (shadow, shade, other side and shadows.)

LOCAL STORAGE

Add data to localStorage temporarily without the need to delete them manually.

import { store } from 'funckage'

const login (userData)=>{
  const response = await api.call("/login-url")
  const { token } = response;

  // default ttl of 24hours (key, data, ttl)
  store.setWithExpiry('token', token)
}

Then you can access it within the ttl;

import { store } from 'funckage'

const getUserData (userData)=>{
  // will return null if queried after ttl
  const token = store.getWithExpiry('token')

  const response = await api.call("/get-data-url", { headers: { 'auth-token': token } } )
  // use response in application
}

Arrays

Basically a package for custom Javascript Functions to be used in the shade of greater projects.

Package Sidebar

Install

npm i funckage

Weekly Downloads

1

Version

0.2.0

License

ISC

Unpacked Size

13.3 kB

Total Files

25

Last publish

Collaborators

  • igmrrf