Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"log"
"net/http"
)
func main() {
@wallrat
wallrat / six-sdk-memoized.js
Last active February 17, 2017 09:23
Wrapping the six-sdk connect() to memoize sessions
import sdk from 'six-sdk'
let cachedSession
let cachedToken
export default {
connect: (token) => {
if (token === cachedToken) {
return cachedSession
}