Skip to content

Commit ebe6845

Browse files
committed
make ::enabled/::disabled configurator optional
1 parent 8c542db commit ebe6845

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/rollup-util/src/Entity.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export type Entity<TName extends string, TConfig extends object, TBase = {}> = T
2020
): Entity<TName, TConfig, TBase>;
2121

2222
disable(
23-
configurator: Configurator<boolean>,
23+
configurator?: Configurator<boolean>,
2424
): Entity<TName, TConfig, TBase>;
2525

2626
configure(
27-
configurator: Configurator<TConfig>,
27+
configurator?: Configurator<TConfig>,
2828
): Entity<TName, TConfig, TBase>;
2929
}
3030

@@ -82,7 +82,7 @@ function onFinalize(
8282

8383
function onEnable(
8484
this: AnyEntity,
85-
configurator: Configurator<boolean>,
85+
configurator: Configurator<boolean> = defaultGetEnabled,
8686
): AnyEntity {
8787
const prev = this.getEnabled;
8888
const next: Configurator<boolean> = async (currentConfig, context) => (
@@ -102,7 +102,7 @@ function onEnable(
102102

103103
function onDisable(
104104
this: AnyEntity,
105-
configurator: Configurator<boolean>,
105+
configurator: Configurator<boolean> = defaultGetEnabled,
106106
): AnyEntity {
107107
const prev = this.getEnabled;
108108
const next: Configurator<boolean> = async (currentConfig, context) => (

0 commit comments

Comments
 (0)