@jtigernova-npm/tiffany-vue 1.2.0 → 1.2.2

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,8 +1,10 @@
1
1
  import { type Ref } from "vue";
2
- export interface BaseState {
2
+ export interface BaseLoadable {
3
3
  allowLoad: Ref<boolean>;
4
4
  loading: Ref<boolean>;
5
5
  onLoad: () => Promise<void>;
6
+ }
7
+ export interface BaseState extends BaseLoadable {
6
8
  load: () => void;
7
9
  }
8
10
  export declare function getBaseStateOpts(): {
@@ -10,7 +12,7 @@ export declare function getBaseStateOpts(): {
10
12
  loading: Ref<boolean>;
11
13
  onLoad: () => Promise<void>;
12
14
  };
13
- export declare function getBaseStateHelper(baseState: BaseState): {
15
+ export declare function getBaseStateHelper(loadable: BaseLoadable): {
14
16
  load: () => void;
15
17
  };
16
18
  export interface TrackableScroll {
@@ -1,10 +1,5 @@
1
1
  import { logDebug, logErrorAlways } from "@jtigernova-npm/tiffany";
2
2
  import { ref } from "vue";
3
- // export interface BaseLoadable {
4
- // allowLoad: boolean;
5
- // loading: Ref<boolean>;
6
- // onLoad: () => Promise<void>;
7
- // }
8
3
  export function getBaseStateOpts() {
9
4
  return {
10
5
  allowLoad: ref(true),
@@ -15,12 +10,12 @@ export function getBaseStateOpts() {
15
10
  },
16
11
  };
17
12
  }
18
- export function getBaseStateHelper(baseState) {
13
+ export function getBaseStateHelper(loadable) {
19
14
  return {
20
15
  load() {
21
- if (!baseState.allowLoad)
16
+ if (!loadable.allowLoad)
22
17
  return;
23
- baseState
18
+ loadable
24
19
  .onLoad()
25
20
  .then(() => {
26
21
  logDebug("BaseState.onLoad() done");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jtigernova-npm/tiffany-vue",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "module": "out/index.js",
5
5
  "type": "module",
6
6
  "typings": "index.d.ts",