@advanced-rest-client/payload-parser-mixin
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.1 • Public • Published

    Published on NPM

    Build Status

    Published on webcomponents.org

    payload-parser-mixin

    A mixin to be implemented to elements that needs to parse request / response body.

    This component is no longer developed. Please, do not use it.

    Usage

    Installation

    npm install --save @advanced-rest-client/payload-parser-mixin

    In a LitElement

    import { LitElement, html } from 'lit-element';
    import { PayloadParserMixin } from '@advanced-rest-client/payload-parser-mixin/payload-parser-mixin.js';
    
    class SampleElement extends PayloadParserMixin(LitElement) {
      render() {
        const encoded = this.encodeUrlEncoded('String to URL encode');
        return html`
        <p>Encoded: ${encoded}</p>
        `;
      }
    }
    customElements.define('sample-element', SampleElement);

    In a Polymer 3 element

    import { PolymerElement, html } from '@polymer/polymer';
    import { PayloadParserMixin } from '@advanced-rest-client/payload-parser-mixin/payload-parser-mixin.js';
    
    class SampleElement extends PayloadParserMixin(PolymerElement) {
      static get template() {
        return html`
        <p>Encoded: [[encoded]]</p>
        `;
      }
    
      _prepareEncoded(value) {
        this.encoded = this.encodeUrlEncoded(value);
      }
    }
    customElements.define('sample-element', SampleElement);

    Development

    git clone https://github.com/advanced-rest-client/payload-parser-mixin
    cd payload-parser-mixin
    npm install

    Running the demo locally

    npm start

    Running the tests

    npm test

    API components

    This components is a part of API components ecosystem

    Install

    npm i @advanced-rest-client/payload-parser-mixin

    DownloadsWeekly Downloads

    390

    Version

    3.0.1

    License

    Apache-2.0

    Unpacked Size

    50 kB

    Total Files

    5

    Last publish

    Collaborators

    • carowright
    • jarrodek
    • twoplustwoone
    • lbauret