1.0.12 • Published 6 years ago

@dnvr/registry v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Registry

A JavaScript library that simulates the Registry.

Install

npm install @dnvr/registry

Usage

import Registry from '@dnvr/registry'

Registry.set( [ 'site', 'background', 'color' ], 'black' ) // Sets the registry entry

Registry.watch( [ 'site', 'background', 'color' ], function ( value ) {
  document.body.style.backgroundColor = value
}) // Attaches a listener to the property and immediately runs callback

Registry.watch( [ 'site', 'background' ], function ( value ) {
  document.body.classList.toggle( 'dark', value === 'dark' )
}) // Attaches a listener

Registry.set( [ 'site', 'background', 'color' ], 'white' ) // Will cause the background to turn white.

Registry.set( [ 'site', 'background' ], 'dark' ) // Will cause the body element to take on the additional class of 'dark'
1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago