Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@advertol/core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@advertol/core

Advertisement zones manager.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
485
decreased by-42.54%
Maintainers
1
Weekly downloads
 
Created
Source

@advertol/core

Build Status BrowserStack Status

Core module for creating Advertol instance.

Install

npm install @advertol/core --save

Usage

import advertol from '@advertol/core';
import CustomAdServerService from './service';
import CustomControl from './control';
import CustomContext from './context';

const instance = advertol({
	zones: [{
		id: 'becky',
		element: document.querySelector('.Zone--becky')
	}],
	service: new CustomAdServerService(),
	control: [
		new CustomControl()
	],
	context: [
		new CustomContext()
	]
});

instance.resolve();

API

advertol(options)

Returns: Advertol

Create Advertol instance.

zones

Type: Object[]

List of zones.

PropertyTypeDescription
elementHTMLElementZone DOM element.
idstringZone ID.
service

Type: Service

Advertisement server service.

control

Type: Control[]

List of controls for Advertol instance.

context

Type: Context[]

List of contexts for Advertol instance.

instance.resolve()

Returns: Promise

Resolves current instance state. This should be run first time and every time you add new zone, control or context to resolve new instance state.

instance.addControl(control)

Add new control.

control

Type: 'Control'

instance.addContext(context)

Add new context.

context

Type: 'Context'

instance.addZone({ element, id })

Add new zone.

PropertyTypeDescription
elementHTMLElementZone DOM element.
idstringZone ID.

instance.destroy()

Destroy instance.

Browser support

Tested in IE9+ and all modern browsers, assuming Promise support is available.

Test

For automated tests, run npm run test:automated (append :watch for watcher support).

License

MIT © Ivan Nikolić

Keywords

FAQs

Package last updated on 08 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc