Skip to content

Commit

Permalink
chore(rn): reuse stream
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Jul 3, 2019
1 parent f9fea76 commit 2186775
Show file tree
Hide file tree
Showing 11 changed files with 834 additions and 557 deletions.
22 changes: 11 additions & 11 deletions client/react-native/app/container/container.gen.js
Expand Up @@ -141,21 +141,21 @@ export class IDServiceNode extends Unary {

@withStoreContext
export class CommitLogStreamServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.commitLogStream
}
}

@withStoreContext
export class EventStreamServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.eventStream
}
}

@withStoreContext
export class EventListServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.eventList
}
}
Expand All @@ -180,7 +180,7 @@ EventListServiceNode.Pagination = EventListServiceNodePagination

@withStoreContext
export class EventUnseenServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.eventUnseen
}
}
Expand Down Expand Up @@ -268,7 +268,7 @@ export class ContactUpdateServiceNode extends Unary {

@withStoreContext
export class ContactListServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.contactList
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ export class ConversationUpdateServiceNode extends Unary {

@withStoreContext
export class ConversationListServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.conversationList
}
}
Expand Down Expand Up @@ -514,21 +514,21 @@ export class ProtocolsServiceNode extends Unary {

@withStoreContext
export class LogStreamServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.logStream
}
}

@withStoreContext
export class LogfileListServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.logfileList
}
}

@withStoreContext
export class LogfileReadServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.logfileRead
}
}
Expand Down Expand Up @@ -570,14 +570,14 @@ export class TestErrorServiceNode extends Unary {

@withStoreContext
export class MonitorBandwidthServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.monitorBandwidth
}
}

@withStoreContext
export class MonitorPeersServiceNode extends Stream {
get service () {
get method () {
return this.props.context.node.service.monitorPeers
}
}
Expand Down
2 changes: 2 additions & 0 deletions client/react-native/app/container/stream.js
Expand Up @@ -31,6 +31,7 @@ export class Stream extends Component {
componentDidMount () {
this.invoke()
}
componentWillUnmount () {}

invoke = async () => {
const stream = await this.method(this.request)
Expand Down Expand Up @@ -124,6 +125,7 @@ export class StreamPagination extends Stream {
if (supBottom) {
if (bottomIndex + 1 !== this.queue.length || change.force) {
this.queue.splice(bottomIndex + 1, 0, newValue)
return
}
return
}
Expand Down

0 comments on commit 2186775

Please sign in to comment.