Bump mobx from 6.5.0 to 6.6.0 (#5570)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
dependabot[bot]andSebastian Malton authored and GitHub committed 2022-06-13 16:17:44 -04:00
1 parent e13183f60e
commit 0dfd03e6df
9 files changed
+33 -32

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ import type { AbortSignal } from "abort-controller";
* Useful for `Promise.race()` applications.
* @param signal The AbortController's signal to reject with
*/
export function rejectPromiseBy(signal: AbortSignal): Promise<void> {
export function rejectPromiseBy(signal: AbortSignal): Promise<never> {
return new Promise((_, reject) => {
signal.addEventListener("abort", reject);
});
@@ -3,6 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import type { IObservableValue } from "mobx";
import { computed } from "mobx";
import syncBoxChannelInjectable from "./sync-box-channel.injectable";
import { messageToChannelInjectionToken } from "../channel/message-to-channel-injection-token";
@@ -17,8 +18,8 @@ const createSyncBoxInjectable = getInjectable({
const messageToChannel = di.inject(messageToChannelInjectionToken);
const getSyncBoxState = (id: string) => di.inject(syncBoxStateInjectable, id);
return <TData>(id: string, initialValue: TData): SyncBox<TData> => {
const state = getSyncBoxState(id);
return <Value>(id: string, initialValue: Value): SyncBox<Value> => {
const state = getSyncBoxState(id) as IObservableValue<Value>;
state.set(initialValue);
@@ -4,21 +4,10 @@
*/
import { getInjectionToken } from "@ogre-tools/injectable";
import type { IComputedValue } from "mobx";
type AsJson<T> = T extends string | number | boolean | null
? T
: T extends Function
? never
: T extends Array<infer V>
? AsJson<V>[]
: T extends object
? { [K in keyof T]: AsJson<T[K]> }
: never;
export interface SyncBox<TValue> {
export interface SyncBox<Value> {
id: string;
value: IComputedValue<AsJson<TValue>>;
set: (value: AsJson<TValue>) => void;
value: IComputedValue<Value>;
set: (value: Value) => void;
}
export const syncBoxInjectionToken = getInjectionToken<SyncBox<any>>({