feat: bug fixes and update core deps

This commit is contained in:
Travis Fischer
2022-03-24 23:34:40 -04:00
parent ea64a04cbb
commit c7a80fb035
11 changed files with 141 additions and 137 deletions

View File

@@ -8,7 +8,9 @@ import { getCanonicalPageId } from './get-canonical-page-id'
const uuid = !!includeNotionIdInUrls
export const getAllPages = pMemoize(getAllPagesImpl, { maxAge: 60000 * 5 })
export const getAllPages = pMemoize(getAllPagesImpl, {
cacheKey: (...args) => JSON.stringify(args)
})
export async function getAllPagesImpl(
rootNotionPageId: string,

View File

@@ -1,11 +1,15 @@
// import ky from 'ky'
import fetch from 'isomorphic-unfetch'
import pMemoize from 'p-memoize'
import ExpiryMap from 'expiry-map'
import { api } from './config'
import * as types from './types'
export const searchNotion = pMemoize(searchNotionImpl, { maxAge: 10000 })
export const searchNotion = pMemoize(searchNotionImpl, {
cacheKey: (args) => args[0]?.query,
cache: new ExpiryMap(10000)
})
async function searchNotionImpl(
params: types.SearchParams