Xcraft-Inc / xcraft-core-goblin

Actor Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elf logic : proxy on shredder parameters

SamLebarbare opened this issue · comments

In this example, i have a newState shredder object in parameter of my updateState(newState) method :
image

It is possible to have a proxified shredder on it ?

Then i can use newState.shifts insteed of newState.get('shifts')

Here the trick:

  /* stateFromGaladriel is received as a Shredder */
  myQuest(stateFromGaladriel) {
    const state = Elf.Spirit.from(GaladrielState)(stateFromGaladriel);
    /* Now here, you can use magic */
    const {id, name} = state;
  }

I close because Elf.Spirit.from works pretty fine now.