2.12.9 β€’ Published 25 days ago

buzzcasting-storage v2.12.9

Weekly downloads
-
License
-
Repository
-
Last release
25 days ago

BuzzCasting Storage

This is a wrapper class to use multiple storage options with BuzzCasting.

BuzzCasting Social Media Wall & Dataviz More info.

Currently supported are: Local Storage, Session Storage, IDB Keyval, Dexie, Window object

Features

  • ✨ Fully customized eslint configuration based on the config by Antfu
  • πŸ§ͺ Write tests quickly and conveniently with vitest
  • 🀝 Supports conventional commits
  • πŸ’… Generate beautiful changelogs with changelogen
  • ♾️ GitHub CI for your build
  • πŸ€– Ready configuration for renovatebot with renovate-config
  • πŸš€ Library releases with just one command

Get started

Example call:

import BuzzcastingStorageManager, {
  IMessages,
  IQuery,
  IStorageManager,
} from 'buzzcasting-storage'

const options: IStorageManager = {
  app: 'my-subdomain',
  version: 'v4',
  token: 'meta',
  bearer: 'bearer_token',
  storage: 'dexie',
  moderation: 'none',
  beforeTime: null,
  delay: 0,
  period: 0,
}

const storageManager = new BuzzcastingStorageManager(options)

const query: IQuery = {
  type: 'messages',
  dashboard: 'dashboard_id',
  widget: 'widget_id',
}

const data: IMessages = storageManager.getMessages(query)

This will initiate a call to the buzzcasting backoffice to retrieve results

The Storage Manager will carry out the API call for the subscriber, and send out a BroadcastChannel on app to inform the subcriber that it can retrieve new data. The broadcast channel facilitates its incorporation in for example a Web Worker.

const broadcastChannel = new BroadcastChannel('my-subdomain')

broadcastChannel.onmessage = (messageEvent: MessageEvent) => {
  this.actions(messageEvent)
}

actions = (messageEvent: MessageEvent) => {
  switch (messageEvent.data.event) {
    case 'widget-update':
      // handle update
      this.widgetUpdated.emit(messageEvent.data.data)
      break
    default:
      // console.log('[storage]', messageEvent.data)
  }
}

Git Clone

git clone https://github.com/TouchFlows/buzzcasting-storage.git
cd buzzcasting-storage
pnpm install

Usage

The project contains the following scripts:

  • dev - Start the development server
  • build - Build for production
  • release - Generate changelog and npm publish
  • lint - Checks your code for any linting errors
  • test - Run all tests
  • test:watch - Run all tests with watch mode
  • test:coverage - Run all tests with code coverage report
  • prepare - Script for setting up husky hooks

License

This template was created under the MIT License.

2.12.9

25 days ago

2.12.7

26 days ago

2.12.8

26 days ago

2.12.5

1 month ago

2.12.6

1 month ago

2.12.4

1 month ago

2.12.0

1 month ago

2.12.3

1 month ago

2.12.1

1 month ago

2.12.2

1 month ago

2.11.6

2 months ago

2.11.7

2 months ago

2.11.5

2 months ago

2.11.4

2 months ago

2.11.3

2 months ago

2.11.1

2 months ago

2.11.2

2 months ago

2.11.0

2 months ago

2.10.12

2 months ago

2.10.13

2 months ago

2.10.14

2 months ago

2.10.10

2 months ago

2.10.11

2 months ago

2.10.9

2 months ago

2.10.7

2 months ago

2.10.8

2 months ago

2.10.5

2 months ago

2.10.6

2 months ago

2.10.3

2 months ago

2.10.4

2 months ago

2.9.6

2 months ago

2.10.1

2 months ago

2.10.2

2 months ago

2.10.0

2 months ago

2.9.5

2 months ago

2.9.4

2 months ago

2.8.0

2 months ago

2.9.2

2 months ago

2.9.1

2 months ago

2.9.3

2 months ago

2.9.0

2 months ago

2.7.0

2 months ago

2.6.1

2 months ago

2.6.0

2 months ago

2.7.2

2 months ago

2.7.1

2 months ago

2.5.0

2 months ago

2.5.2

2 months ago

2.5.1

2 months ago

2.5.4

2 months ago

2.5.3

2 months ago

2.5.6

2 months ago

2.5.5

2 months ago

2.5.8

2 months ago

2.5.7

2 months ago

2.5.9

2 months ago

2.5.10

2 months ago

2.5.12

2 months ago

2.5.13

2 months ago

2.4.0

2 months ago

2.3.0

3 months ago

2.2.0

3 months ago

2.3.1

3 months ago

2.1.2

3 months ago

2.1.1

3 months ago

2.1.0

3 months ago

2.0.8

3 months ago

2.0.3

3 months ago

2.0.5

3 months ago

2.0.4

3 months ago

2.0.7

3 months ago

2.0.6

3 months ago

2.0.2

3 months ago

2.0.1

3 months ago

1.0.13

3 months ago

1.0.12

3 months ago

1.0.11

3 months ago

1.0.10

3 months ago

1.0.9

3 months ago

1.0.8

3 months ago

1.0.7

3 months ago

1.0.6

3 months ago

1.0.4

3 months ago

1.0.3

3 months ago