Skip to content

Commit

Permalink
fix: Export Endpoint through core
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Jul 14, 2020
1 parent 6e9b8b0 commit 8b60dea
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/core/rollup.config.js
Expand Up @@ -15,6 +15,7 @@ const dependencies = Object.keys(pkg.dependencies)
![
'@rest-hooks/normalizr',
'@rest-hooks/use-enhanced-reducer',
'@rest-hooks/endpoint',
'@babel/runtime',
].includes(dep),
);
Expand Down
Expand Up @@ -62,7 +62,7 @@ for (const makeProvider of [makeCacheProvider, makeExternalCacheProvider]) {
renderRestHook.cleanup();
});

it.only('useSubscription() + useCache()', async () => {
it('useSubscription() + useCache()', async () => {
jest.useFakeTimers();
const frequency: number = (PollingArticleResource.detailShape()
.options as any).pollFrequency;
Expand Down
2 changes: 1 addition & 1 deletion packages/endpoint/src/__tests__/endpoint.ts
Expand Up @@ -291,7 +291,7 @@ describe('Endpoint', () => {
);
});
it.only('should use extended token', async () => {
it('should use extended token', async () => {
//sdf @ts-expect-error
const UserCurrent = new AuthEndpoint(fetchAuthd, {
token: 'password3',
Expand Down
8 changes: 4 additions & 4 deletions packages/rest-hooks/src/index.ts
Expand Up @@ -24,6 +24,8 @@ export {
schema as schemas,
// TODO: get rid of these exports once core has been out for a while
usePromisifiedDispatch,
Endpoint,
Index,
} from '@rest-hooks/core';
export type {
FetchShape,
Expand Down Expand Up @@ -54,9 +56,6 @@ export type {
NormalizeNullable,
Denormalize,
DenormalizeNullable,
} from '@rest-hooks/core';
export { Endpoint, Index } from '@rest-hooks/endpoint';
export type {
EndpointExtraOptions,
FetchFunction,
ResolveType,
Expand All @@ -68,7 +67,8 @@ export type {
IndexInterface,
IndexParams,
ArrayElement,
} from '@rest-hooks/endpoint';
} from '@rest-hooks/core';

export { Resource, SimpleResource } from './resource';
export type { SchemaDetail, SchemaList } from './resource/types';
export {
Expand Down
14 changes: 11 additions & 3 deletions packages/rest-hooks/src/resource/SimpleResource.ts
@@ -1,6 +1,14 @@
import { FlatEntity, schema, ReadShape, MutateShape } from '@rest-hooks/core';
import type { AbstractInstanceType } from '@rest-hooks/core';
import { Endpoint, EndpointExtraOptions } from '@rest-hooks/endpoint';
import {
FlatEntity,
schema,
ReadShape,
MutateShape,
Endpoint,
} from '@rest-hooks/core';
import type {
AbstractInstanceType,
EndpointExtraOptions,
} from '@rest-hooks/core';

import { SchemaDetail, SchemaList } from './types';
import { NotImplementedError } from './errors';
Expand Down

0 comments on commit 8b60dea

Please sign in to comment.