pubfig-npm

1.0.3 • Public • Published

#pubfig-npm

####version 1.0.3 - July 25, 2019

##Installing using npm

npm install --save pubfig-npm

##Usage

####Import pubfig package

import pubfig from 'pubfig-npm';

In react add the freestar config object prior to mounting the main App component.

class Navigation extends React.Component {
	componentWillMount() {
		pubfig.configure({"publisherName": "webdesignledger"});
	}
	render() {
		return (
			<div>
				<h1>freestar news</h1>
			</div>
		);
	}
}

####Adding Ad Div Components In React after the div has mounted create an unit object and invoke the addUnit method: 

class Ad300250 extends React.Component {
    componentDidMount(prevProps, prevState) {
		// create unit with keys
        const unit = {
            placementName: 'My_Sidebar_300x250_1',
            slotId: this.props.id
		}
		// invoke addUnit method with unit as first argument
        pubfig.addUnit(unit)
    }
    render() {
            return (
                <div id={this.props.id}>
                </div>
            )
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i pubfig-npm

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

16.3 kB

Total Files

7

Last publish

Collaborators

  • freestar_engineering