Skip to content

Commit

Permalink
refactor: move files to vanilla folder
Browse files Browse the repository at this point in the history
  • Loading branch information
afiiif committed Feb 3, 2024
1 parent 0f4290f commit e8782eb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './store';
export * from './fetcher';
export * from './vanilla/init-store';
export * from './vanilla/fetcher';

export * from './react/create-store';
export * from './react/create-stores';
Expand Down
2 changes: 1 addition & 1 deletion src/react/create-mutation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InitStoreOptions } from '../store';
import { noop } from '../utils';
import { InitStoreOptions } from '../vanilla/init-store';
import { createStore, UseStore } from './create-store';

export type MutationState<TVar, TResponse = any, TError = unknown> = {
Expand Down
2 changes: 1 addition & 1 deletion src/react/create-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
StoreInitializer,
StoreState,
Subscribers,
} from '../store';
} from '../vanilla/init-store';

export type WatchProps<T> = { selectDeps?: SelectDeps<T>; render: (state: T) => any };

Expand Down
4 changes: 2 additions & 2 deletions src/react/create-stores.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useMemo, useRef, useState } from 'react';

import { getValue, Maybe, noop } from '../utils';
import {
initStore,
InitStoreOptions,
Expand All @@ -8,8 +9,7 @@ import {
SetStoreState,
StoreState,
Subscribers,
} from '../store';
import { getValue, Maybe, noop } from '../utils';
} from '../vanilla/init-store';
import { WatchProps } from './create-store';

export type StoreKey = Record<string, any> | undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/fetcher.ts → src/vanilla/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createError, getValue, identityFn } from './utils';
import { createError, getValue, identityFn } from '../utils';

const encodeParams = (params: Record<string, string | number | boolean>) =>
Object.entries(params)
Expand Down
2 changes: 1 addition & 1 deletion src/store.ts → src/vanilla/init-store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getValue, Maybe, noop } from './utils';
import { getValue, Maybe, noop } from '../utils';

export type StoreState = Record<string, any>;
export type SetStoreState<T> = Partial<T> | ((state: T) => Partial<T>);
Expand Down

0 comments on commit e8782eb

Please sign in to comment.