Created
March 12, 2017 12:32
-
-
Save brakmic/bf401baeb75af96a626309021fc2cb41 to your computer and use it in GitHub Desktop.
registering vr modules and dispatching messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public registerModule(): Observable<IServiceMessage> { | |
return this.asObservable().map((mod) => { | |
if (!_.isNil(mod) && | |
!_.isNil(mod.id) && | |
!_.isNil(mod.name)) { | |
this.store.dispatch( { type: VR_MODULE_ADDED, payload: mod }); | |
return <IServiceMessage> { | |
id: '0000', | |
content: `Registered vr module '${mod.name}'` | |
}; | |
} | |
return <IServiceMessage>{ | |
id: '000', | |
content: mod ? `Could not register vr module '${mod.id}'` : | |
`Could not register unknown vr module` | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment