Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. export class DiceAnimation {
  2.  
  3. private _playing: boolean
  4.  
  5. set playing(val: boolean) {
  6. this._playing = val
  7. }
  8.  
  9. // Here I want to export information to be used in other system. Is that even possible ?
  10. @animProp
  11. get playing(): boolean {
  12. return this._playing
  13. }
  14.  
  15. }
  16.  
  17. export class Reducer {
  18.  
  19. // Variant 1.
  20. // Here I want to import information from DiceAnimation instance. Is that even possible?
  21. @getAnimProp("DiceAnimation", "playing")
  22. dicePlaying: boolean
  23.  
  24.  
  25. // Variant 2.
  26. // Here I want to import information from DiceAnimation instance. Is that even possible?
  27. reduce(@getAnimProp("DiceAnimation", "playing") dicePlaying: boolean,): any {
  28. // logic
  29. }
  30.  
  31. }
  32.  
  33. // Decorator functions.
  34. export function animProp() {
  35.  
  36. }
  37.  
  38. export function getAnimProp() {
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement