@ng-atomic/core 20.24.3 → 20.45.12

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.
@@ -258,9 +258,11 @@ function provideComponent(abstract, typeOrFactory) {
258
258
  function makeProvideComopnentConfigure(abstract) {
259
259
  return (typeOrFactory) => provideComponent(abstract, typeOrFactory);
260
260
  }
261
- function TokenizedType() {
261
+ function TokenizedType(defaultType) {
262
262
  return function (type) {
263
- type[TOKEN] = new InjectionToken(type.name);
263
+ type[TOKEN] = defaultType
264
+ ? new InjectionToken(type.name, { providedIn: 'root', factory: () => async () => await defaultType() })
265
+ : new InjectionToken(type.name);
264
266
  };
265
267
  }
266
268
  function getToken(type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-atomic/core",
3
- "version": "20.24.3",
3
+ "version": "20.45.12",
4
4
  "homepage": "https://github.com/xx-machina/plaform/tree/main/packages/@ng-atomic/core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,7 +51,7 @@ declare function makeProvideComopnentConfigure<Store = any, Component = any>(abs
51
51
  provide: any;
52
52
  useValue: () => Promise<Type<Component>>;
53
53
  };
54
- declare function TokenizedType(): <T extends Type<any>>(type: T) => void;
54
+ declare function TokenizedType(defaultType?: TypeFactory<any>): <T extends Type<any>>(type: T) => void;
55
55
  declare function getToken(type: Type<any>): any;
56
56
  declare enum HostType {
57
57
  Dir = "\u0275dir",