Class

App

App()

Constructor

# new App()

The main application file. You can import it as many times as you want, and you will get the same instance

View Source src/App.js, line 6

Members

Methods

# addCustomProperty(name, value, ctxopt)

Creates CustomProperty and keeps it in App instance
Parameters:
Name Type Attributes Default Description
name string The CSS property name
value string | number The CSS property value
ctx HTMLElement <optional>
document.documentElement The DOM Element style with apply to

View Source src/App.js, line 58

this
Example
import app from 'App';
app.addCustomProperty('hello', 'world');

# getCustomProperty(name) → {any}

Get CSS property from App instance
Parameters:
Name Type Description
name string The CSS property name

View Source src/App.js, line 71

any
Example
import app from 'App';
app.getCustomProperty('hello');

# subscribeResize(name, handler)

Add handler to window resize event
Parameters:
Name Type Description
name string The handler identifier
handler fn The callback to run on window resize

View Source src/App.js, line 84

this
Example
import app from 'App';
app.subscribeResize('my-resize-handler', () => {console.log('I'm listening to resize')});

# unsubscribeResize(name)

Removes handler from window resize event
Parameters:
Name Type Description
name string The handler identifier

View Source src/App.js, line 96

this
Example
import app from 'App';
app.unsubscribeResize('my-resize-handler');