🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@couchwarfare/client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@couchwarfare/client

``` javascript import { useOnlineReducer, fetchAccessToken, timestamp } from '@couchwarfare/client'

latest
npmnpm
Version
0.1.8
Version published
Weekly downloads
12
-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

@couchwarfare/client

import { useOnlineReducer, fetchAccessToken, timestamp } from '@couchwarfare/client'

const [accessToken, setAccessToken] = useState()
const gameId = 'RANDOMGAMEID'
const name = 'RANDOMNAME'

useEffect(() => {
    fetchAccessToken({ name }).then((v) => setAccessToken(v))
}, [])

const [state, dispatcher, readyState] = useOnlineReducer(reducer, initialArg, init, accessToken, roomId)

// Prints the timestamp. The offset will be set after calling fetchAccessToken.
console.log(timestamp())

FAQs

Package last updated on 30 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts