2.0.2 • Published 9 months ago

@frankhoodbs/data-layer-helper v2.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Data layer helper

This is a JavaScript utility designed to simplify the interaction and manipulation of data layers. It's particularly useful for managing and tracking data in complex applications, enhancing data handling capabilities with ease.

Version License

Installation

Install the package via npm:

npm install @frankhoodbs/data-layer-helper

or using yarn:

yarn add @frankhoodbs/data-layer-helper

Usage

First, import the useDataLayer function from the package:

import { useDataLayer } from '@frankhoodbs/data-layer-helper';

Then, you can initialize it with a set of layers and optionally a store object. Using TypeScript generics here provides the benefit of autocompletion in your IDE:

const { push } = useDataLayer<['layer1', 'layer2']>(['layer1', 'layer2']);

Pushing Data

You can push data into your layers as follows:

push(
  { key: 'value' },
  {
    layer1: { additionalKey: 'additionalValue' },
    layer2: { key: 'overrideValue' },
  }
);

Parameters

  • data: The data object to be pushed to every layer.
  • overrides: (Optional) An object containing layer-specific overrides.
  • debug: (Optional) If set to true, the data will be logged to the console instead of being pushed to the layers.

Features

  • Easy setup for managing multiple data layers.
  • Layer-specific data overrides.
  • Debug mode for development and testing.
2.0.2

9 months ago

2.0.1

9 months ago

1.2.12

10 months ago

1.2.11

10 months ago

1.2.9

12 months ago

1.2.10

12 months ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.1

2 years ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.4

2 years ago

1.0.1

2 years ago