How to use piral-ext - 3 common examples

To help you get started, we’ve selected a few piral-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smapiot / piral / src / packages / piral / src / api.ts View on Github external
export function extendPiralApi(settings: PiralExtSettings = {}, customApis: Extend | Array = []) {
  const extenders = Array.isArray(customApis) ? customApis : [customApis];
  return [...extenders, ...createStandardApi(settings)];
}
github smapiot / piral / packages / piral / src / render.tsx View on Github external
extendApi(api: PiralCoreApi): PiletApi {
      return {
        ...api,
        ...createFetchApi({
          base: origin,
        }),
        ...createGqlApi(client),
      };
    },
    translations: getTranslations(translations),
github smapiot / piral / packages / piral / src / render.tsx View on Github external
export function renderInstance(options: PiralOptions = {}) {
  const { routes = {}, selector = '#app', gateway, translations, components } = options;
  const origin = getGateway(gateway);
  const client = setupGqlClient({
    url: origin,
  });

  const Piral = createInstance({
    availableModules: getAvailableModules(),
    requestModules() {
      return fetch(`${origin}/api/v1/pilet`)
        .then(res => res.json())
        .then(res => res.items);
    },
    components,
    Loader,
    Dashboard,
    ErrorInfo,
    extendApi(api: PiralCoreApi): PiletApi {
      return {

piral-ext

Set of standard plugins with component definitions for extending piral-core.

MIT
Latest version published 14 days ago

Package Health Score

84 / 100
Full package analysis