-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Conversation
@@ -394,7 +405,10 @@ export class Subscriptions { | |||
event[eventPropertyName] = values[eventPropertyIndex] | |||
}) | |||
|
|||
subscription[event.eventSymbol]?.listeners.forEach((listener) => listener(event)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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 }) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
No description provided.