metarhia / swayer

Schema based frontend framework 👀
MIT License
52 stars 11 forks source link

Add possibility to create external API adapters #27

Open rohiievych opened 2 years ago

rohiievych commented 2 years ago

Is your feature request related to a problem? Please describe. We have no communication implemented with external services.

Describe the solution you'd like Add component external API configuration, so that we can communicate with backend:

config: {
  api: {
    impress: {
      adapter: '/adapters/impress.js',
    },
  },
};

// use
await this.api.impress.iface.getData();

Describe alternatives you've considered Write an http or ws client.

Additional context

  1. Develop a generic API RPC communication contract like Impress does now.
  2. Write an adapter for Impress.
  3. Leave possibility for further API extensions.