Skip to content

Commit

Permalink
chore!: Get rid of duplicated asyncComputed
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Migrate to using asyncComputed in package mobx-utils

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
  • Loading branch information
Iku-turso and jansav committed Jan 24, 2024
1 parent 850a3aa commit b6fd8b3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 950 deletions.
22 changes: 1 addition & 21 deletions packages/injectable/react/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/// <reference types="react" />
import type {
DiContainer,
DiContainerForInjection,
} from '@lensapp/injectable';
import { IComputedValue } from 'mobx';
import type { DiContainer, DiContainerForInjection } from '@lensapp/injectable';

interface DiContainerProviderProps {
di: DiContainer | DiContainerForInjection;
Expand Down Expand Up @@ -54,20 +50,4 @@ export interface WithInjectables {

export const withInjectables: WithInjectables;

export type IAsyncComputed<T> = {
value: IComputedValue<T>;
pending: IComputedValue<boolean>;
invalidate: () => void;
};

type AsyncComputedParams<T> = {
getValueFromObservedPromise: () => Promise<T>;
valueWhenPending?: T;
betweenUpdates?: 'show-pending-value' | 'show-latest-value';
};

export function asyncComputed<T>(
configuration: AsyncComputedParams<T>,
): IAsyncComputed<T>;

export function registerInjectableReact(di: DiContainer): void;
8 changes: 1 addition & 7 deletions packages/injectable/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import withInjectables, {
DiContextProvider,
} from './src/withInjectables/withInjectables';

import asyncComputed from './src/asyncComputed/asyncComputed';
import registerInjectableReact from './src/registerInjectableReact/registerInjectableReact';

export {
withInjectables,
DiContextProvider,
asyncComputed,
registerInjectableReact,
};
export { withInjectables, DiContextProvider, registerInjectableReact };
93 changes: 0 additions & 93 deletions packages/injectable/react/src/asyncComputed/asyncComputed.js

This file was deleted.

Loading

0 comments on commit b6fd8b3

Please sign in to comment.