Closed matt-gadd closed 3 years ago
To note these two aren't quite like for like, for example the createIcacheMiddleware
takes an interface for the state but the withType
requires the API of the actual middleware, in this case it's something like ICacheResult<StateInterface>
:
import icache, { ICacheResult } from '@dojo/framework/core/middleware/icache'
const myIcache = icache.withType<ICacheResult<{ foo: string }>>();
Enhancement
With https://github.com/dojo/framework/pull/819, there is simply no need to have these separate bespoke
create
factories such ascreateIcacheMiddleware
anymore. The end user can usewithType
to stamp the types and that means we don't have to flip flop between separate exports for typed and untyped middleware.before:
after: