Skip to content

Commit

Permalink
refactor: avoid using export * as for tree-shaking friendly (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
PuruVJ authored Dec 25, 2024
1 parent e2c4896 commit bfafe1f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ export * from './effectScope.js';
export * from './signal.js';
export * from './system.js';
export * from './types.js';
export * as unstable from './unstable/index.js';
/**
* @deprecated Use `unstable` instead.
*/
export * as Unstable from './unstable/index.js';
export * from './unstable/index.js';
35 changes: 29 additions & 6 deletions src/unstable/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
export * from './asyncComputed.js';
export * from './asyncEffect.js';
export * from './asyncSystem.js';
export * from './computedArray.js';
export * from './computedSet.js';
export * from './equalityComputed.js';

import { AsyncComputed, asyncComputed } from './asyncComputed.js';
import { AsyncEffect, asyncEffect } from './asyncEffect.js';
import { asyncCheckDirty } from './asyncSystem.js';
import { computedArray } from './computedArray.js';
import { computedSet } from './computedSet.js';
import { EqualityComputed, equalityComputed } from './equalityComputed.js';

export const unstable: {
AsyncComputed: typeof AsyncComputed;
asyncComputed: typeof asyncComputed;
AsyncEffect: typeof AsyncEffect;
asyncEffect: typeof asyncEffect;
asyncCheckDirty: typeof asyncCheckDirty;
computedArray: typeof computedArray;
computedSet: typeof computedSet;
EqualityComputed: typeof EqualityComputed;
equalityComputed: typeof equalityComputed;
} = {
AsyncComputed,
asyncComputed,
AsyncEffect,
asyncEffect,
asyncCheckDirty,
computedArray,
computedSet,
EqualityComputed,
equalityComputed,
};

0 comments on commit bfafe1f

Please sign in to comment.