1.4.4 • Published 3 years ago

@zeus-technology/util v1.4.4

Weekly downloads
19
License
MIT
Repository
github
Last release
3 years ago

@zeus/util

This module contains utility functions used by the Zeus Platform.

Usage

zeusNotice()

This function performs a console.info() with whatever your message is, but it sticks it inside obvious visual separation. It is intended to be called the same as console.log(), and wraps around that interface.

const { zeusNotice } = require('@zeus/util');

zeusNotice("Some message here.");

forceRefresh()

This function allows you to force a refresh on one or more ad slots. It takes a single parameter, which can either be a zeus-ad id, or an array of zeus-ad ids.

const { forceRefresh } = require('@zeus/util');

# Force refresh a single ad
forceRefresh("top_right")

# Force refresh a specific list of ads
forceRefresh(["top_right", "bottom", "inline"])

# force refresh all zeus ads on the page
const ads = [...document.getElementsByClassName("zeus-ad")].map(node => node.id)
forceRefresh(ads)

forceRebuildAndRefresh()

This function allows you to force a rebuild of your ad slot and refresh one or more ads. It takes a single parameter, which can either be a zeus-ad id, or an array of zeus-ad ids.

This function is useful when you have a Single Page Application and you want to rebuild your ad slots when you navigate to a new page, but do not re-render your DOM tree.

const { forceRebuildAndRefresh } = require('@zeus/util');

# Force rebuild a single ad
forceRebuildAndRefresh("top_right")

# Force rebuild a specific list of ads
forceRebuildAndRefresh(["top_right", "bottom", "inline"])

# force rebuild all zeus ads on the page
const ads = [...document.getElementsByClassName("zeus-ad")].map(node => node.id)
forceRebuildAndRefresh(ads)
1.4.4

3 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0-alpha.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.1-alpha.2

5 years ago

1.1.1-alpha.0

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.10-alpha.1

5 years ago

1.0.10-alpha.0

5 years ago

1.0.9

5 years ago

1.0.9-alpha.0

5 years ago

1.0.8

5 years ago

1.0.6

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago