Skip to content

Commit

Permalink
fix: deno formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cprice404 committed Jul 16, 2024
1 parent 872e1c6 commit 222d3f0
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions examples/deno/web-sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import { serve } from 'http'
import {
CacheClient,
CacheDelete,
CacheGet,
CacheSet,
CacheDelete,
Configurations,
CredentialProvider,
} from 'momento'
Expand Down Expand Up @@ -45,37 +45,37 @@ export const handler = async (_request: Request): Promise<Response> => {
const value = 'FOO'

const setResponse = await momento.set(cacheName, key, value)
switch (setResponse.type) {
case CacheSet.Success:
console.log('Key stored successfully!');
break;
case CacheSet.Error:
console.log(`Error setting key: ${setResponse.toString()}`);
break;
}
switch (setResponse.type) {
case CacheSet.Success:
console.log('Key stored successfully!')
break
case CacheSet.Error:
console.log(`Error setting key: ${setResponse.toString()}`)
break
}

const getResponse = await momento.get(cacheName, key)
switch (getResponse.type) {
case CacheGet.Hit:
console.log(`cache hit: ${getResponse.valueString()}`);
break;
case CacheGet.Miss:
console.log('cache miss');
break;
case CacheGet.Error:
console.log(`Error: ${getResponse.message()}`);
break;
}
switch (getResponse.type) {
case CacheGet.Hit:
console.log(`cache hit: ${getResponse.valueString()}`)
break
case CacheGet.Miss:
console.log('cache miss')
break
case CacheGet.Error:
console.log(`Error: ${getResponse.message()}`)
break
}

const deleteResponse = await momento.delete(cacheName, key)
switch (deleteResponse.type) {
case CacheDelete.Success:
console.log('Key deleted successfully!');
break;
case CacheDelete.Error:
console.log(`Error deleting key: ${deleteResponse.toString()}`);
break;
}
switch (deleteResponse.type) {
case CacheDelete.Success:
console.log('Key deleted successfully!')
break
case CacheDelete.Error:
console.log(`Error deleting key: ${deleteResponse.toString()}`)
break
}

return new Response(
`Tested the Momento cache using: <br /> Key: ${key} | Value: ${value}`,
Expand Down

0 comments on commit 222d3f0

Please sign in to comment.