This is a wrapper class to use multiple storage options with BuzzCasting.
npm install buzzcasting-utilsThis 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
- β¨ 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
Example call:
``ts
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.
`ts
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)
}
}
`
`shell``
git clone https://github.com/TouchFlows/buzzcasting-storage.git
cd buzzcasting-storage
pnpm install
The project contains the following scripts:
- dev - Start the development serverbuild
- - Build for productionrelease
- - Generate changelog and npm publishlint
- - Checks your code for any linting errorstest
- - Run all teststest:watch
- - Run all tests with watch modetest:coverage
- - Run all tests with code coverage reportprepare` - Script for setting up husky hooks
-
This template was created under the MIT License.