Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typeresolvers #3

Closed
Domitnator opened this issue Apr 19, 2018 · 4 comments
Closed

Typeresolvers #3

Domitnator opened this issue Apr 19, 2018 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@Domitnator
Copy link

Hi Guys,

In the Client.js I noticed that the typeresolvers are initialised:

let typeResolvers = [
  new TypeResolver('about_us', () => new AboutUs()),
  new TypeResolver('accessory', () => new Accessory()),
  new TypeResolver('article', () => new Article()),
  new TypeResolver('brewer', () => new Brewer()),
  new TypeResolver('cafe', () => new Cafe()),
  new TypeResolver('coffee', () => new Coffee()),
  new TypeResolver('fact_about_us', () => new FactAboutUs()),
  new TypeResolver('grinder', () => new Grinder()),
  new TypeResolver('hero_unit', () => new HeroUnit()),
  new TypeResolver('home', () => new Home()),
  new TypeResolver('hosted_video', () => new HostedVideo()),
  new TypeResolver('office', () => new Office()),
  new TypeResolver('tweet', () => new Tweet())
];

From the KenticoCloudDeliveryTypeScriptSDK:

image

But, correct me if i am wrong, they are never used? Why bother configuring them? Or are they also used for parsing links in Rich text elements?

@petrsvihlik petrsvihlik added the question Further information is requested label Apr 19, 2018
@Domitnator
Copy link
Author

Any update on this?

@Enngage
Copy link

Enngage commented May 25, 2018

Hi, I just randomly bumped into this question - as far as I can see the models are actually being used. They are not used for 'intellisense' of particular properties, but if you take a look e.g. here , you will see that the models are used to 'map' properties from Kentico cloud (which often contains underscore) to more javascript friendly format (camelCase). Additionally links are being resolved as well with resolveContentLink.

These type resolvers are not necessary though - you can use SDK without them.

You can also use model generator to generate these models automatically for you.

@petrsvihlik
Copy link
Contributor

Hi @Domitnator! Was your question answered satisfactorily? Can we close the issue?

@Domitnator
Copy link
Author

Yes! Thanks for the effort! Case closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants