Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Lamb <[email protected]>
  • Loading branch information
keelerm84 and kinyoklion authored Jan 28, 2025
1 parent da8caea commit 904e807
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EdgeProvider } from '../../src/featureStore';
import CacheableStoreProvider from '../../src/featureStore/cacheableStoreProvider';
import * as testData from '../testData.json';

describe('CacheableStoreProvider', () => {
describe('given a mock edge provider with test data', () => {
const mockEdgeProvider: EdgeProvider = {
get: jest.fn(),
};
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('CacheableStoreProvider', () => {
expect(mockGet).toHaveBeenCalledTimes(1);
});

it('prefetch does not reset', async () => {
it('does not reset on prefetch', async () => {
const cacheProvider = new CacheableStoreProvider(mockEdgeProvider, 'rootKey', 0);
await cacheProvider.get('rootKey');
await cacheProvider.get('rootKey');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class CacheableStoreProvider implements EdgeProvider {
constructor(
private readonly _edgeProvider: EdgeProvider,
private readonly _rootKey: string,
private readonly _cacheTtlMs: number | undefined = undefined,
private readonly _cacheTtlMs?: number,
) {}

/**
Expand All @@ -49,7 +49,7 @@ export default class CacheableStoreProvider implements EdgeProvider {
}

/**
* Fetches environment payload data from the origin in according with the caching configuration.
* Fetches environment payload data from the origin in accordance with the caching configuration.
*
* You should only call this function within a feature store to pre-fetch and cache payload data in environments
* where its expensive to make multiple outbound requests to the origin
Expand Down

0 comments on commit 904e807

Please sign in to comment.