How to use the telejson.stringify function in telejson

To help you get started, we’ve selected a few telejson 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 storybookjs / storybook / lib / channel-postmessage / src / index.ts View on Github external
send(event: ChannelEvent): Promise {
    const iframeWindow = this.getWindow();
    if (!iframeWindow) {
      return new Promise((resolve, reject) => {
        this.buffer.push({ event, resolve, reject });
      });
    }

    const data = stringify({ key: KEY, event }, { maxDepth: 15 });

    // TODO: investigate http://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage
    // might replace '*' with document.location ?
    iframeWindow.postMessage(data, '*');
    return Promise.resolve(null);
  }
github storybookjs / storybook / lib / api / src / lib / store-setup.ts View on Github external
_.fn('set', function(key: string, data: object) {
    return _.set(this._area, this._in(key), stringify(data, { maxDepth: 50 }));
  });
  _.fn('get', function(key: string, alt: string) {

telejson

A library for teleporting rich data to another place.

MIT
Latest version published 1 year ago

Package Health Score

77 / 100
Full package analysis