Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// TODO ^^ Figure out how to do this without casting
}
public isLoaded({treeId, userId}): boolean {
const treeUserId = getTreeUserId({
treeId,
userId
});
return !!this.storeSource.get(treeUserId);
}
}
@injectable()
export class TreeUserLoaderArgs {
@inject(TYPES.FirebaseReference) @tagged(TAGS.TREE_USERS_REF, true) public firebaseRef: Reference;
@inject(TYPES.ISubscribableTreeUserStoreSource) public storeSource: ISubscribableTreeUserStoreSource;
}
this.sigmaNodesUpdater = sigmaNodesUpdater;
this.sigmaEdgesUpdater = sigmaEdgesUpdater;
}
public subscribe(obj: ISubscribable) {
const updateNodes = this.sigmaNodesUpdater.handleUpdate.bind(this.sigmaNodesUpdater);
const updateEdges = this.sigmaEdgesUpdater.handleUpdate.bind(this.sigmaEdgesUpdater);
obj.onUpdate(updateNodes); // TODO: i'm pretty sure all the new edge logic is handled in nodesUpdater rather than edges updater. need to fix this
obj.onUpdate(updateEdges);
}
}
@injectable()
export class CanvasUIArgs {
@inject(TYPES.ISigmaNodesUpdater)
@tagged(TAGS.MAIN_SIGMA_INSTANCE, true)
public sigmaNodesUpdater;
@inject(TYPES.ISigmaEdgesUpdater)
@tagged(TAGS.MAIN_SIGMA_INSTANCE, true)
public sigmaEdgesUpdater;
}
});
objectFirebaseAutoSaver.initialSave();
objectFirebaseAutoSaver.start();
// TODO: this needs to add the actual value into the db
return contentItem;
}
}
@injectable()
export class AutoSaveMutableSubscribableContentStoreArgs {
@inject(TYPES.ISubscribableContentStoreSource)
public storeSource;
@inject(TYPES.Array)
public updatesCallbacks;
@inject(TYPES.FirebaseReference)
@tagged(TAGS.CONTENT_REF, true)
public contentFirebaseRef: Reference;
}
throw new RangeError(JSON.stringify(type) + ' is not a valid update type');
}
}
}
@injectable()
export class StoreSourceUpdateListenerCoreArgs {
// @inject(TYPES.ISigmaNodes) public sigmaNodes: ISigmaNodes
@inject(TYPES.ISigmaNodesUpdater)
@tagged(TAGS.MAIN_SIGMA_INSTANCE, true)
public sigmaNodesUpdater: ISigmaNodesUpdater;
@inject(TYPES.ISigmaEdgesUpdater)
@tagged(TAGS.MAIN_SIGMA_INSTANCE, true)
public sigmaEdgesUpdater: ISigmaEdgesUpdater;
@inject(TYPES.IOneToManyMap)
@tagged(TAGS.CONTENT_ID_SIGMA_IDS_MAP, true)
public contentIdSigmaIdMap: IOneToManyMap;
@inject(TYPES.BranchesStore)
public store: Store;
}
public shuriken: IWeapon;
public constructor(
@tagged("canThrow", false) katana: IWeapon,
@tagged("canThrow", true) shuriken: IWeapon
) {
this.katana = katana;
this.shuriken = shuriken;
}
}
kernel.bind("Samurai").to(Samurai);
kernel.bind("IWeapon").to(Katana).whenTargetTagged("canThrow", false);
kernel.bind("IWeapon").to(Shuriken).whenTargetTagged("canThrow", true);
let throwable = tagged("canThrow", true);
let notThrowable = tagged("canThrow", false);
@inject("IWeapon", "IWeapon")
class Samurai2 implements ISamurai {
public katana: IWeapon;
public shuriken: IWeapon;
public constructor(
@throwable("canThrow", false) katana: IWeapon,
@notThrowable("canThrow", true) shuriken: IWeapon
) {
this.katana = katana;
this.shuriken = shuriken;
}
}
@inject("IWeapon", "IWeapon")
class Samurai3 implements ISamurai {
export const detectsLanguage = (language: ProgrammingLanguage) => {
return tagged(DETECT_LANGUAGE_TAG, language);
};
parentId: treeNode.parentId,
treeId,
});
const edge = sigmaGraph.edges(edgeId);
if (!edge) {
throw new Error('SigmaInstanceGraphEdge with id of ' + edgeId + ' could not be found');
}
const color = ProficiencyUtils.getColor(contentUserProficiency);
edge.color = color;
}
}
@injectable()
export class SigmaEdgesUpdaterArgs {
@inject(TYPES.IOneToManyMap)
@tagged(TAGS.CONTENT_ID_SIGMA_IDS_MAP, true)
public contentIdSigmaIdMap: IOneToManyMap;
@inject(TYPES.IStoreGetters) public getters: IStoreGetters
}
const treeFirebaseRef = this.firebaseRef.child(treeId);
const treeAutoSaver: IObjectFirebaseAutoSaver =
new ObjectFirebaseAutoSaver({
syncableObjectFirebaseRef: treeFirebaseRef,
syncableObject: tree
});
treeAutoSaver.start();
return treeData;
}
}
@injectable()
export class TreeLoaderAndAutoSaverArgs {
@inject(TYPES.FirebaseReference) @tagged(TAGS.TREES_REF, true) public firebaseRef: Reference;
@inject(TYPES.ITreeLoader) @tagged(TAGS.SPECIAL_TREE_LOADER, true) public treeLoader: ITreeLoader;
}
const userFirebaseRef = this.firebaseRef.child(userId);
const userAutoSaver: IObjectFirebaseAutoSaver =
new ObjectFirebaseAutoSaver({
syncableObjectFirebaseRef: userFirebaseRef,
syncableObject: user
});
userAutoSaver.start();
return user;
}
}
@injectable()
export class UserLoaderAndAutoSaverArgs {
@inject(TYPES.FirebaseReference) @tagged(TAGS.USERS_REF, true) public firebaseRef: Reference;
@inject(TYPES.IUserLoader) public userLoader: IUserLoader;
}
@injectable()
export class SubscribableContentStoreSourceArgs {
@inject(TYPES.Object) public hashmap;
@inject(TYPES.Array) public updatesCalbacks: any[];
@inject(TYPES.ObjectDataTypes)
@tagged(TAGS.CONTENT_DATA, true)
private type: CustomStoreDataTypes;
}
@injectable()
export class SubscribableContentUserStoreSourceArgs {
@inject(TYPES.Object) public hashmap;
@inject(TYPES.Array) public updatesCalbacks: any[];
@inject(TYPES.ObjectDataTypes)
@tagged(TAGS.CONTENT_USERS_DATA, true)
private type: CustomStoreDataTypes;
}