-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix stores package imports from atoms package
- Loading branch information
Showing
15 changed files
with
129 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
import { | ||
destroyNodeFinish, | ||
destroyNodeStart, | ||
scheduleDependents, | ||
} from './classes/GraphNode' | ||
import { createInjector } from './factories/createInjector' | ||
import { | ||
destroyBuffer, | ||
flushBuffer, | ||
getEvaluationContext, | ||
startBuffer, | ||
} from './utils/evaluationContext' | ||
|
||
export * from '@zedux/core' | ||
export * from './classes/index' | ||
export * from './factories/index' | ||
export * from './injectors/index' | ||
export { getEcosystem, getInternals, setInternals, wipe } from './store/index' | ||
export * from './types/index' | ||
|
||
// These are very obfuscated on purpose. Don't use! They're for Zedux packages. | ||
export const zi = { | ||
b: destroyNodeStart, | ||
c: createInjector, | ||
d: destroyBuffer, | ||
e: destroyNodeFinish, | ||
f: flushBuffer, | ||
g: getEvaluationContext, | ||
s: startBuffer, | ||
u: scheduleDependents, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// This file contains lots of code and types duplicated from the `@zedux/atoms` | ||
// package. This is the best way to get them in the `tsc` build without breaking | ||
// type compatibility with the external `@zedux/atoms` package. That breakage | ||
// happens when we give TS a `@zedux/atoms` `paths` alias and let it pull in | ||
// duplicated classes e.g. in `dist/esm/atoms/classes/...` | ||
import { PromiseState } from '@zedux/atoms' | ||
|
||
export type InjectorDescriptor<T = any> = T extends undefined | ||
? { | ||
cleanup?: () => void | ||
result?: T | ||
type: string | ||
} | ||
: { | ||
cleanup?: () => void | ||
result: T | ||
type: string | ||
} | ||
|
||
export const prefix = '@@zedux' | ||
|
||
/** | ||
* IMPORTANT! Keep these in sync with `@zedux/atoms/utils/general.ts` | ||
*/ | ||
export const Invalidate = 1 | ||
export const Destroy = 2 | ||
export const PromiseChange = 3 | ||
export const EventSent = 4 | ||
|
||
export const getErrorPromiseState = <T>(error: Error): PromiseState<T> => ({ | ||
error, | ||
isError: true, | ||
isLoading: false, | ||
isSuccess: false, | ||
status: 'error', | ||
}) | ||
|
||
export const getInitialPromiseState = <T>(data?: T): PromiseState<T> => ({ | ||
data, | ||
isError: false, | ||
isLoading: true, | ||
isSuccess: false, | ||
status: 'loading' as const, | ||
}) | ||
|
||
export const getSuccessPromiseState = <T>(data: T): PromiseState<T> => ({ | ||
data, | ||
isError: false, | ||
isLoading: false, | ||
isSuccess: true, | ||
status: 'success', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.