wit-php icon indicating copy to clipboard operation
wit-php copied to clipboard

Define Context as Immutable

Open tgallice opened this issue 9 years ago • 2 comments

I think the Context must be immutable to prevent side effects. This way we can track all context modifications and why not provide a history ?

tgallice avatar Aug 10 '16 13:08 tgallice

Can you elaborate on this? At least within the action mapping we want to modify context data, since this is what helps wit.ai to predict the next actions.

hfinck avatar Aug 10 '16 13:08 hfinck

What I mean it's we should not update the current Context but return a new Context with previous value and new one added. It's just to prevent side effets.

tgallice avatar Aug 10 '16 17:08 tgallice