How to use the @airbnb/lunar.settings function in @airbnb/lunar

To help you get started, we’ve selected a few @airbnb/lunar 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 airbnb / lunar / packages / apollo / src / index.ts View on Github external
bootstrapClient() {
    if (this.client) {
      return;
    }

    const { links, resolvers, typeDefs } = this.settings;

    this.client = new ApolloClient({
      cache: new InMemoryCache(),
      connectToDevTools: __DEV__,
      link: ApolloLink.from(links),
      name: Core.settings.name,
      resolvers,
      typeDefs,
      version: pkg.version,
    });

    if (__DEV__) {
      // eslint-disable-next-line no-underscore-dangle
      window.__APOLLO_CLIENT__ = this.client;
    }
  }
github airbnb / lunar / packages / app-shell / src / index.tsx View on Github external
export type State = {
  breadcrumbs: Breadcrumb[];
  data: { [id: string]: object };
  toasts: Toast[];
};

export { AppContext };

export class AppShell extends React.Component {
  static propTypes = {
    name: componentName.isRequired,
  };

  static defaultProps = {
    name: Core.settings.name,
  };

  state = {
    breadcrumbs: [],
    data: {},
    toasts: [],
  };

  addBreadcrumb = (label: string, props: Breadcrumb['props'] = {}) => {
    const id = uuid();

    this.setState(prevState => ({
      breadcrumbs: [
        ...prevState.breadcrumbs,
        {
          id,