1.0.12 • Published 4 years ago

@dnvr/registry v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
4 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

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago