Skip to content

Commit

Permalink
feat(remote-context): rename state machine for manual reload and upda…
Browse files Browse the repository at this point in the history
…te related types
  • Loading branch information
arashagp committed Dec 25, 2024
1 parent 785d641 commit 1cbfd84
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/remote-context/src/remote-context.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {AlwatrRemoteContextStateMachineBase, type ServerContextState} from './base.js';
import {
AlwatrRemoteContextStateMachineBase as AlwatrManualReloadRemoteContextStateMachineBase,
type ServerContextState,
} from './base.js';

import type {FetchOptions} from '@alwatr/nanolib';
import type {FetchOptions} from '@alwatr/flux';
import type {Json} from '@alwatr/type-helper';

export class AlwatrRemoteContextStateMachine<T extends Json = Json> extends AlwatrRemoteContextStateMachineBase<T> {
export class AlwatrManualReloadRemoteContextStateMachine<T extends Json = Json> extends AlwatrManualReloadRemoteContextStateMachineBase<T> {
/**
* Current state.
*/
Expand All @@ -14,6 +18,10 @@ export class AlwatrRemoteContextStateMachine<T extends Json = Json> extends Alwa
return this.context_;
}

get isLoadedFromRemote(): boolean {
return this.isLoadedFromRemote_;
}

request(fetchOptions?: Partial<FetchOptions>): void {
return this.request_(fetchOptions);
}
Expand All @@ -25,3 +33,5 @@ export class AlwatrRemoteContextStateMachine<T extends Json = Json> extends Alwa
this.clean_();
}
}

export type {ServerContextState as ManualReloadServerContextState};

0 comments on commit 1cbfd84

Please sign in to comment.