mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Remove Angular (#17534)
GitOrigin-RevId: 7a0d45e17d9905fa75569e2d19ca59caa4a41565
This commit is contained in:
-28
@@ -1,28 +0,0 @@
|
||||
import { ScopeValueStore } from '../../../../../types/ide/scope-value-store'
|
||||
import { Scope } from '../../../../../types/angular/scope'
|
||||
import _ from 'lodash'
|
||||
|
||||
export class AngularScopeValueStore implements ScopeValueStore {
|
||||
// eslint-disable-next-line no-useless-constructor
|
||||
constructor(readonly $scope: Scope) {}
|
||||
|
||||
get(path: string) {
|
||||
return _.get(this.$scope, path)
|
||||
}
|
||||
|
||||
set(path: string, value: unknown): void {
|
||||
this.$scope.$applyAsync(() => _.set(this.$scope, path, value))
|
||||
}
|
||||
|
||||
watch<T>(
|
||||
path: string,
|
||||
callback: (newValue: T) => void,
|
||||
deep: boolean
|
||||
): () => void {
|
||||
return this.$scope.$watch(
|
||||
path,
|
||||
(newValue: T) => callback(deep ? _.cloneDeep(newValue) : newValue),
|
||||
deep
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user