![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@bity/preact-conversion-components
Advanced tools
A collection of components that make conversions against the Bity API.
Readme
A collection of components that make conversions against the Bity API.
See src/
for all the components and to learn how they work.
They are provided as ES2015 modules, and have already been transpiled once from JSX to regular ES2015+.
You will probably want to use these in combination with
@bity/preact-base-components
, @bity/preact-exchange-client
, and
@bity/styles
.
npm install \
@bity/api \
@bity/data-stores \
@bity/preact-conversion-components \
@bity/styles \
preact \
preact-redux
It's somewhat convoluted to use these components because they try to do everything for you once provided with the correct information. They will periodically poll when there are listeners, and won't when there aren't any - small conveniences like that.
import { h, render } from 'preact';
import { Provider } from 'preact-redux';
import { BityApiClient } from '@bity/api';
import { Order } from '@bity/api/models';
import * as currenciesDataStore from '@bity/data-stores/currencies';
import * as orderDataStore from '@bity/data-stores/order';
import { getStore, initializeStores } from '@bity/data-stores/store';
import { ExchangeRate } from '@bity/preact-conversion-components/exchange-rate
// Initialize the API
const bityApiClient = new BityApiClient({
exchangeApiUrl,
legacyV2ApiUrl,
clientId // Request a clientId from Bity's support.
});
// Initialize the state container with an API client instance
initializeStores({ bityApiClient });
// Get the store to get its dispatcher
const store = dataStore.getStore();
const { dispatch } = store;
// Get currencies information
currenciesDataStore.addDataListener(dispatch);
// To make a single initial request for exchange data
orderDataStore.removeDataListener(dispatch);
dispatch({ type: orderDataStore.DATA_UPDATE, payload: new Order() });
orderDataStore.addDataListener(dispatch);
render(
<Provider store={store}>
<ExchangeRate />
<Provider/>,
document.getElementById('root')
);
Save the file and run your favorite bundler/transpiler combination, and then:
<head>
<!-- First include the default styling for the components. -->
<link rel="stylesheet" type="text/css" href="node_modules/@bity/styles/index.css"/>
</head>
<body>
<!-- Define a mount point: -->
<div id="root"></div>
<!-- Then include the bundle use. -->
<script src="bundle.js"></script>
</body>
You should see some updating exchange rate on the screen.
FAQs
A collection of components that make conversions against the Bity API.
The npm package @bity/preact-conversion-components receives a total of 2 weekly downloads. As such, @bity/preact-conversion-components popularity was classified as not popular.
We found that @bity/preact-conversion-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.