Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On demand service api #33

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

prodderman
Copy link

No description provided.

@@ -394,7 +405,10 @@ export class Subscriptions {
event[eventPropertyName] = values[eventPropertyIndex]
})

subscription[event.eventSymbol]?.listeners.forEach((listener) => listener(event))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

@@ -309,6 +318,8 @@ export class Subscriptions {
Object.entries(stateChange).forEach(([key, val]) => {
this.state[key] = val
})

this.stateSubscriptions.forEach((listener) => listener(this.state))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need this state outside?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To know if it is replying now or not, how much time has replayed.

@@ -78,3 +78,10 @@ export interface ISubscribeMessage {
addTimeSeries?: ITimeSeriesList
removeTimeSeries?: ISubscriptionList
}

type OnDemandMethod = 'replay' | 'setSpeed' | 'stopAndResume' | 'stopAndClear'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a separate class for onDemand and add typed methods:

  • reply
  • setSpeed
  • stopAndResume
  • stopAndClear

} else if (method === 'clear') {
this.endpoint.invokeOnDemandService(
{ op: 'stopAndClear', args: [] },
changeStateIfSuccess({ speed: 0, replay: false, clear: true, time: 0 })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's it connected with the onDemand service?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean state? I think it implies to change the state when we invoke any of onDemand methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants