@agile-ts/core
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
import { Collection, DefaultDataItem, ItemKey, State, Agile } from '../internal'; | ||
import { Agile, State, Collection, DefaultDataItem, ItemKey } from '../internal'; | ||
export declare type GroupKey = string | number; | ||
@@ -3,0 +3,0 @@ export interface GroupAddOptionsInterface { |
@@ -28,3 +28,3 @@ import { Collection, DefaultDataItem, ItemKey, Computed, StorageKey } from '../internal'; | ||
*/ | ||
getPersistableValue(): ItemKey; | ||
getPersistableValue(): StorageKey; | ||
} |
@@ -20,3 +20,7 @@ "use strict"; | ||
get value() { | ||
return super.value; | ||
// Note can't use 'super.value' because of 'https://github.com/Microsoft/TypeScript/issues/338' | ||
// Add state to foundState (for auto tracking used states in computed functions) | ||
if (this.agileInstance().runtime.trackState) | ||
this.agileInstance().runtime.foundStates.add(this); | ||
return this._value; | ||
} | ||
@@ -23,0 +27,0 @@ //========================================================================================================= |
@@ -9,3 +9,3 @@ import { Agile } from './internal'; | ||
export declare class Integration<F = any> { | ||
ready?: boolean; | ||
ready: boolean; | ||
config: IntegrationConfig<F>; | ||
@@ -16,3 +16,3 @@ constructor(config: IntegrationConfig); | ||
agileInstance: () => Agile; | ||
loadedIntegrations: Set<Integration>; | ||
integrations: Set<Integration>; | ||
constructor(agileInstance: Agile); | ||
@@ -19,0 +19,0 @@ /** |
@@ -7,2 +7,3 @@ "use strict"; | ||
constructor(config) { | ||
this.ready = false; | ||
this.config = config; | ||
@@ -14,3 +15,3 @@ } | ||
constructor(agileInstance) { | ||
this.loadedIntegrations = new Set(); | ||
this.integrations = new Set(); | ||
this.agileInstance = () => agileInstance; | ||
@@ -32,3 +33,3 @@ // Integrate initial Integrations | ||
} | ||
this.loadedIntegrations.add(integration); | ||
this.integrations.add(integration); | ||
if (this.agileInstance().config.logJobs) | ||
@@ -44,3 +45,6 @@ console.log(`Agile: Successfully integrated '${integration.config.name}'`); | ||
bind() { | ||
this.loadedIntegrations.forEach(integration => integration.config.bind && integration.config.bind(this.agileInstance())); | ||
this.integrations.forEach(integration => { | ||
integration.config.bind && integration.config.bind(this.agileInstance()); | ||
integration.ready = true; | ||
}); | ||
} | ||
@@ -54,3 +58,3 @@ //========================================================================================================= | ||
update(componentInstance, updatedData) { | ||
this.loadedIntegrations.forEach(integration => integration.config.updateMethod && integration.config.updateMethod(componentInstance, updatedData)); | ||
this.integrations.forEach(integration => integration.config.updateMethod && integration.config.updateMethod(componentInstance, updatedData)); | ||
} | ||
@@ -64,5 +68,5 @@ //========================================================================================================= | ||
hasIntegration() { | ||
return this.loadedIntegrations.size > 0; | ||
return this.integrations.size > 0; | ||
} | ||
} | ||
exports.Integrations = Integrations; |
export * from './agile'; | ||
export * from './state'; | ||
export * from './state/dep'; | ||
export { Computed } from './computed'; | ||
export * from './collection'; | ||
@@ -6,12 +9,9 @@ export * from './collection/group'; | ||
export * from './collection/selector'; | ||
export * from './computed'; | ||
export * from './event'; | ||
export * from './state'; | ||
export { Dep } from './state/dep'; | ||
export * from './runtime'; | ||
export * from './storage'; | ||
export * from './integrations'; | ||
export * from './runtime/subscription/sub'; | ||
export * from './utils'; | ||
export * from './integrations'; | ||
export * from './runtime/subscription/CallbackSubscriptionContainer'; | ||
export * from './runtime/subscription/ComponentSubscriptionContainer'; | ||
export * from './utils'; |
"use strict"; | ||
// This file exposes Agile functions and types to the outside world. | ||
// It also serves as a cyclic dependency workaround. | ||
// All internal Agile modules must import from here. | ||
// It also serves as a cyclic dependency workaround | ||
// https://medium.com/visual-development/how-to-fix-nasty-circular-dependency-issues-once-and-for-all-in-javascript-typescript-a04c987cf0de. | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -16,4 +16,12 @@ if (k2 === undefined) k2 = k; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// !! All internal Agile modules must import from here. | ||
// Otherwise we can run into annoying cycle dependencies | ||
// Agile | ||
__exportStar(require("./agile"), exports); | ||
// State | ||
__exportStar(require("./state"), exports); | ||
__exportStar(require("./state/dep"), exports); | ||
// Computed | ||
var computed_1 = require("./computed"); | ||
Object.defineProperty(exports, "Computed", { enumerable: true, get: function () { return computed_1.Computed; } }); | ||
// Collection | ||
@@ -24,17 +32,12 @@ __exportStar(require("./collection"), exports); | ||
__exportStar(require("./collection/selector"), exports); | ||
// Computed | ||
__exportStar(require("./computed"), exports); | ||
// Event | ||
__exportStar(require("./event"), exports); | ||
// State | ||
__exportStar(require("./state"), exports); | ||
var dep_1 = require("./state/dep"); | ||
Object.defineProperty(exports, "Dep", { enumerable: true, get: function () { return dep_1.Dep; } }); | ||
// Internal Classes | ||
__exportStar(require("./runtime"), exports); | ||
__exportStar(require("./storage"), exports); | ||
__exportStar(require("./integrations"), exports); | ||
__exportStar(require("./runtime/subscription/sub"), exports); | ||
__exportStar(require("./utils"), exports); | ||
__exportStar(require("./integrations"), exports); | ||
__exportStar(require("./runtime/subscription/CallbackSubscriptionContainer"), exports); | ||
__exportStar(require("./runtime/subscription/ComponentSubscriptionContainer"), exports); | ||
// Utils | ||
__exportStar(require("./utils"), exports); |
{ | ||
"name": "@agile-ts/core", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "BennoDev", | ||
@@ -13,2 +13,15 @@ "license": "ISC", | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.2.12", | ||
"@types/mocha": "^8.0.2", | ||
"@types/node": "^14.6.0", | ||
"chai": "^4.2.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"mocha": "^8.1.1", | ||
"prettier": "2.0.5", | ||
"ts-node": "^8.10.2", | ||
"tsc-watch": "^4.1.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "^3.9.7" | ||
}, | ||
"publishConfig": { | ||
@@ -15,0 +28,0 @@ "access": "public" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146044
3350
11