@dereekb/dbx-core 10.1.4 → 10.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { Maybe, ReadableError } from '@dereekb/util';
2
2
  import { DbxActionContextStoreSourceInstance } from './action.store.source';
3
- import { WorkUsingContext, WorkUsingObservable, WorkInstanceDelegate } from '@dereekb/rxjs';
3
+ import { WorkUsingContext, WorkUsingObservable, WorkInstanceDelegate, Work } from '@dereekb/rxjs';
4
4
  import { Observable } from 'rxjs';
5
5
  /**
6
6
  * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.
@@ -12,6 +12,15 @@ export declare class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> imp
12
12
  success(result: O): void;
13
13
  reject(error: Maybe<ReadableError | Observable<ReadableError>>): void;
14
14
  }
15
- export type HandleActionWithFunctionOrContext<T = unknown, O = unknown> = HandleActionFunction<T, O> | HandleActionWithContext<T, O>;
15
+ /**
16
+ * @deprecated use Work instead.
17
+ */
18
+ export type HandleActionWithFunctionOrContext<T = unknown, O = unknown> = Work<T, O>;
19
+ /**
20
+ * @deprecated use WorkUsingObservable instead.
21
+ */
16
22
  export type HandleActionFunction<T = unknown, O = unknown> = WorkUsingObservable<T, O>;
17
- export type HandleActionWithContext<T = unknown, O = unknown> = WorkUsingContext<T, O>;
23
+ /**
24
+ * @deprecated use WorkUsingContext instead.
25
+ */
26
+ export type HandleActionUsingContext<T = unknown, O = unknown> = WorkUsingContext<T, O>;
@@ -24,7 +24,12 @@ export declare abstract class DbxActionContextBaseSource<T = unknown, O = unknow
24
24
  * Use to trigger the action directly.
25
25
  */
26
26
  trigger(): void;
27
- readyValue(value: T): void;
27
+ readyValue(value: T | Observable<T>): void;
28
+ /**
29
+ * Triggers the context and then readies the value.
30
+ * @param value
31
+ */
32
+ triggerWithValue(value: T | Observable<T>): void;
28
33
  reset(): void;
29
34
  enable(key?: DbxActionDisabledKey, enable?: boolean): void;
30
35
  disable(key?: DbxActionDisabledKey, disable?: boolean): void;
@@ -1,8 +1,8 @@
1
1
  import { DbxActionContextSourceReference } from './action.reference';
2
2
  import { ActionContextStoreSource } from './action.store.source';
3
- import { HandleActionFunction } from './action.handler';
4
3
  import { DbxActionContextBaseSource } from './action.holder';
5
4
  import { Destroyable, Maybe } from '@dereekb/util';
5
+ import { Work } from '@dereekb/rxjs';
6
6
  import { OnDestroy } from '@angular/core';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
@@ -18,7 +18,7 @@ export interface DbxActionContextMachineConfig<T = unknown, O = unknown> {
18
18
  *
19
19
  * If false, will not subscribe/handle valueReady$ events.
20
20
  */
21
- handleValueReady: HandleActionFunction<T, O> | false;
21
+ handleValueReady: Work<T, O> | false;
22
22
  /**
23
23
  * Optional function to execute after the action has succeeded.
24
24
  */
@@ -21,6 +21,6 @@ import * as i19 from "./directive/state/action.working.component";
21
21
  import * as i20 from "@angular/common";
22
22
  export declare class DbxCoreActionModule {
23
23
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxCoreActionModule, never>;
24
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreActionModule, [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionDisabledOnSuccessDirective, typeof i10.DbxActionEnforceModifiedDirective, typeof i11.DbxActionAutoTriggerDirective, typeof i12.dbxActionValueStreamDirective, typeof i13.DbxActionAutoModifyDirective, typeof i14.DbxActionValueDirective, typeof i15.DbxActionContextLoggerDirective, typeof i16.DbxActionPreSuccessDirective, typeof i17.DbxActionHasSuccessDirective, typeof i18.DbxActionSuccessHandlerDirective, typeof i19.DbxActionIsWorkingDirective], [typeof i20.CommonModule], [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionDisabledOnSuccessDirective, typeof i10.DbxActionEnforceModifiedDirective, typeof i11.DbxActionAutoTriggerDirective, typeof i12.dbxActionValueStreamDirective, typeof i13.DbxActionAutoModifyDirective, typeof i14.DbxActionValueDirective, typeof i15.DbxActionContextLoggerDirective, typeof i16.DbxActionPreSuccessDirective, typeof i17.DbxActionHasSuccessDirective, typeof i18.DbxActionSuccessHandlerDirective, typeof i19.DbxActionIsWorkingDirective]>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreActionModule, [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i7.DbxActionHandlerValueDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionDisabledOnSuccessDirective, typeof i10.DbxActionEnforceModifiedDirective, typeof i11.DbxActionAutoTriggerDirective, typeof i12.dbxActionValueStreamDirective, typeof i13.DbxActionAutoModifyDirective, typeof i14.DbxActionValueDirective, typeof i15.DbxActionContextLoggerDirective, typeof i16.DbxActionPreSuccessDirective, typeof i17.DbxActionHasSuccessDirective, typeof i18.DbxActionSuccessHandlerDirective, typeof i19.DbxActionIsWorkingDirective], [typeof i20.CommonModule], [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i7.DbxActionHandlerValueDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionDisabledOnSuccessDirective, typeof i10.DbxActionEnforceModifiedDirective, typeof i11.DbxActionAutoTriggerDirective, typeof i12.dbxActionValueStreamDirective, typeof i13.DbxActionAutoModifyDirective, typeof i14.DbxActionValueDirective, typeof i15.DbxActionContextLoggerDirective, typeof i16.DbxActionPreSuccessDirective, typeof i17.DbxActionHasSuccessDirective, typeof i18.DbxActionSuccessHandlerDirective, typeof i19.DbxActionIsWorkingDirective]>;
25
25
  static ɵinj: i0.ɵɵInjectorDeclaration<DbxCoreActionModule>;
26
26
  }
@@ -1,8 +1,8 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
3
- import { HandleActionWithFunctionOrContext } from '../../action.handler';
4
- import { Maybe } from '@dereekb/util';
3
+ import { FactoryWithInput, GetterOrValue, Maybe } from '@dereekb/util';
5
4
  import { DbxActionHandlerInstance } from './action.handler.instance';
5
+ import { Work } from '@dereekb/rxjs';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.
@@ -20,8 +20,18 @@ export declare abstract class AbstractDbxActionHandlerDirective<T = unknown, O =
20
20
  * Directive that wraps and controls a DbxActionHandlerInstance.
21
21
  */
22
22
  export declare class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {
23
- get handlerFunction(): Maybe<HandleActionWithFunctionOrContext<T, O>>;
24
- set handlerFunction(handlerFunction: Maybe<HandleActionWithFunctionOrContext<T, O>>);
23
+ get handlerFunction(): Maybe<Work<T, O>>;
24
+ set handlerFunction(handlerFunction: Maybe<Work<T, O>>);
25
25
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionHandlerDirective<any, any>, never>;
26
26
  static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionHandlerDirective<any, any>, "[dbxActionHandler]", never, { "handlerFunction": { "alias": "dbxActionHandler"; "required": false; }; }, {}, never, never, false, never>;
27
27
  }
28
+ /**
29
+ * Directive that passes
30
+ */
31
+ export declare class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {
32
+ get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>;
33
+ set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>);
34
+ ngOnInit(): void;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionHandlerValueDirective<any, any>, never>;
36
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionHandlerValueDirective<any, any>, "[dbxActionHandlerValue]", never, { "handlerValue": { "alias": "dbxActionHandlerValue"; "required": false; }; }, {}, never, never, false, never>;
37
+ }
@@ -1,6 +1,6 @@
1
1
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
2
- import { HandleActionWithFunctionOrContext } from '../../action.handler';
3
- import { Maybe, Destroyable, Initialized } from '@dereekb/util';
2
+ import { Maybe, Destroyable, Initialized, GetterOrValue, FactoryWithInput } from '@dereekb/util';
3
+ import { Work } from '@dereekb/rxjs';
4
4
  export declare const DBX_ACTION_HANDLER_LOCK_KEY = "dbxActionHandler";
5
5
  /**
6
6
  * Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.
@@ -9,9 +9,12 @@ export declare class DbxActionHandlerInstance<T = unknown, O = unknown> implemen
9
9
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
10
10
  private _sub;
11
11
  private _handlerFunction;
12
- readonly handlerFunction$: import("rxjs").Observable<HandleActionWithFunctionOrContext<T, O>>;
13
- get handlerFunction(): Maybe<HandleActionWithFunctionOrContext<T, O>>;
14
- set handlerFunction(handlerFunction: Maybe<HandleActionWithFunctionOrContext<T, O>>);
12
+ private _handlerValue;
13
+ readonly handlerFunction$: import("rxjs").Observable<Work<T, O>>;
14
+ get handlerFunction(): Maybe<Work<T, O>>;
15
+ set handlerFunction(handlerFunction: Maybe<Work<T, O>>);
16
+ get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>;
17
+ set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>);
15
18
  private _delegate;
16
19
  constructor(source: DbxActionContextStoreSourceInstance<T, O>);
17
20
  init(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-core",
3
- "version": "10.1.4",
3
+ "version": "10.1.5",
4
4
  "peerDependencies": {
5
5
  "@dereekb/util": "*",
6
6
  "@dereekb/rxjs": "*",