| 61 | private readonly viewPropertyFilter?: ViewPropertyFilter; |
| 62 | |
| 63 | constructor(params: { |
| 64 | resourceId: string, |
| 65 | resourceType: ResourceType, |
| 66 | event: IEngineEvent, |
| 67 | getRevision: () => number, |
| 68 | getNetworking: () => INetworking, |
| 69 | getState: () => any, |
| 70 | lsStore: ILsStore, |
| 71 | dispatch: (action: any) => void, |
| 72 | }) { |
| 73 | const { resourceId, resourceType, getRevision, getNetworking, lsStore, event, getState, dispatch } = params; |
| 74 | this.resourceId = resourceId; |
| 75 | this.resourceType = resourceType; |
| 76 | this.getRevision = getRevision; |
| 77 | this.getNetworking = getNetworking; |
| 78 | this.bufferStorage = new BufferStorage(resourceId, resourceType, lsStore); |
| 79 | this.event = event; |
| 80 | this.cancelQuit = null; |
| 81 | void this.prepare(); |
| 82 | this.getState = getState; |
| 83 | this.dispatch = dispatch; |
| 84 | if (resourceType === ResourceType.Datasheet) { |
| 85 | this.viewPropertyFilter = new ViewPropertyFilter(getState, dispatch, resourceId, { onError: this.event.onError }); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Push the operation into the send queue, SyncEngine will ensure that the data is sent to the server in version order |