Conversation
| return this.events; | ||
| } | ||
|
|
||
| async retrieve(key): Promise<unknown> { |
There was a problem hiding this comment.
Make retrieve a generic so that it’s called with a type:
ex: async function retrieve(…)
we will want specific type helpers which pass a type in like retrieveString which returns retrieve(…)
| @@ -0,0 +1,24 @@ | |||
| import {Event} from './event'; | |||
|
|
|||
| export class State { | |||
There was a problem hiding this comment.
for the state class make sure to include an optional StateData argument in the form step for which includes any preexisting state.
also make sure to include the adapter logic. the state class acts as a proxy and gets called by the user but internally passes all the calls, which are just save and retrieve for now, to the adapter. why use an adapter? we want settings and important values stored on device whenever possible and each platform handles it differently. writing adapters gives us a standardized interface to work with keys while also writing custom logic per platform.
added event and state classes and also added save and retrieve methods