How to use the @frontity/wp-source/src function in @frontity/wp-source

To help you get started, weโ€™ve selected a few @frontity/wp-source 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 frontity / frontity / packages / head-tags / src / __tests__ / head-tags.tests.ts View on Github external
beforeEach(() => {
  // Create store.
  const config: HeadTagsPackage = clone(headTagsPackage());

  // Mock wp-source state.
  const {
    state: { source }
  } = clone(wpSource());
  config.state.source = source;
  config.state.source.api = "https://test.frontity.io/wp-json";

  // Mock router state.
  config.state.router = { link: "/" };

  // Mock site url.
  config.state.frontity = { url: "https://mars.frontity.org" };

  // Initialize store.
  store = createStore(config);
});
github frontity / frontity / packages / head-tags / src / __tests__ / state.tests.ts View on Github external
beforeEach(() => {
  warn.mockClear();

  // Create store.
  const config: HeadTagsPackage = clone(headTagsPackage());

  // Mock wp-source state.
  config.state.source = clone(wpSource()).state.source;
  config.state.source.api = "https://test.frontity.io/wp-json";
  // Mock router state.
  config.state.router = { link: "/" };
  // Mock site url.
  config.state.frontity = { url: "https://mars.frontity.org" };
  // Initialize store.
  store = createStore(config);
});

@frontity/wp-source

A Frontity source package for the REST API of self-hosted and WordPress.com sites

Apache-2.0
Latest version published 3 years ago

Package Health Score

60 / 100
Full package analysis

Popular @frontity/wp-source functions