feat: scaffold mvp shell and content runtime
This commit is contained in:
24
js/content/registry/bundle-resolver.js
Normal file
24
js/content/registry/bundle-resolver.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export function createBundleResolver(cityRegistry) {
|
||||
return {
|
||||
resolveCityBundle(cityId) {
|
||||
const city = cityRegistry.getCity(cityId)
|
||||
|
||||
return city ? city.bundle : null
|
||||
},
|
||||
ensureCityBundle(cityId) {
|
||||
const bundle = this.resolveCityBundle(cityId)
|
||||
|
||||
if (!bundle) {
|
||||
return null
|
||||
}
|
||||
|
||||
return {
|
||||
cityId,
|
||||
...bundle,
|
||||
status: 'ready',
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default createBundleResolver
|
||||
Reference in New Issue
Block a user