Skip to content

Commit 659ff18

Browse files
committed
refactor(tweakpane): rename startChangeEffect to sync
1 parent 2e12466 commit 659ff18

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

libs/tweakpane/src/lib/binding.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ export class NgtTweakBinding<TValue> {
6969
});
7070

7171
constructor() {
72-
this.blade.startChangeEffect(this.bindingApi);
73-
this.label.startChangeEffect(this.bindingApi);
74-
this.debounce.startDebounceEffect(this.bindingApi, (ev) => {
72+
this.blade.sync(this.bindingApi);
73+
this.label.sync(this.bindingApi);
74+
this.debounce.sync(this.bindingApi, (ev) => {
7575
if (this.asHostDirective && typeof this.asHostDirective === 'object') {
7676
this.value.set(this.asHostDirective.out(ev.value) as TValue);
7777
} else {

libs/tweakpane/src/lib/blade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class NgtTweakBlade {
1515
};
1616
}
1717

18-
startChangeEffect(api: () => BladeApi | null) {
18+
sync(api: () => BladeApi | null) {
1919
return effect(
2020
() => {
2121
const _api = api();

libs/tweakpane/src/lib/button.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export class NgtTweakButton {
4747
});
4848
});
4949

50-
this.label.startChangeEffect(this.buttonApi);
51-
this.title.startChangeEffect(this.buttonApi);
52-
this.blade.startChangeEffect(this.buttonApi);
50+
this.label.sync(this.buttonApi);
51+
this.title.sync(this.buttonApi);
52+
this.blade.sync(this.buttonApi);
5353

5454
inject(DestroyRef).onDestroy(() => {
5555
this.buttonApi()?.dispose();

libs/tweakpane/src/lib/debounce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class NgtTweakDebounce {
88

99
private injector = inject(Injector);
1010

11-
startDebounceEffect<T>(
11+
sync<T>(
1212
api: () => {
1313
on: (evName: 'change', cb: (ev: TpChangeEvent<T>) => void) => void;
1414
off: (evName: 'change', cb: (ev: TpChangeEvent<T>) => void) => void;

libs/tweakpane/src/lib/folder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export class NgtTweakFolder {
3535
isSelf = true;
3636

3737
constructor() {
38-
this.title.startChangeEffect(this.folder);
39-
this.blade.startChangeEffect(this.folder);
38+
this.title.sync(this.folder);
39+
this.blade.sync(this.folder);
4040

4141
effect((onCleanup) => {
4242
const folder = this.folder();

libs/tweakpane/src/lib/label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class NgtTweakLabel {
1111
return { label: untracked(this.label), tag: untracked(this.tag) };
1212
}
1313

14-
startChangeEffect(api: () => { label?: string | null; tag?: string | null } | null) {
14+
sync(api: () => { label?: string | null; tag?: string | null } | null) {
1515
return effect(
1616
() => {
1717
const _api = api();

libs/tweakpane/src/lib/list.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export class NgtTweakList<TOptionValue> {
4747
});
4848

4949
constructor() {
50-
this.label.startChangeEffect(this.listApi);
51-
this.blade.startChangeEffect(this.listApi);
52-
this.debounce.startDebounceEffect(this.listApi, (ev) => {
50+
this.label.sync(this.listApi);
51+
this.blade.sync(this.listApi);
52+
this.debounce.sync(this.listApi, (ev) => {
5353
this.value.set(ev.value);
5454
});
5555

libs/tweakpane/src/lib/title.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class NgtTweakTitle {
1010
return untracked(this.title);
1111
}
1212

13-
startChangeEffect(api: () => { title: string | undefined } | null) {
13+
sync(api: () => { title: string | undefined } | null) {
1414
return effect(
1515
() => {
1616
const _api = api();

0 commit comments

Comments
 (0)