npm v1.2.0
v1.2.0 release of the @finos/fdc3
npm package, corresponding with the FDC3 Standard v1.2.
Release highlights
New ES6 Imports
The new methods from the FDC3 1.2 Standard, raiseIntentForContext()
and getInfo()
, can now be imported:
import { raiseIntentForContext, getInfo } from '@finos/fdc3'
const info = getInfo()
console.log('FDC3 version: ' + info.fdc3Version)
await raiseIntentForContext({
type: 'fdc3.instrument',
id: {
ticker: 'AAPL'
}
})
New utility functions
- The
fdc3Ready()
function wraps waiting for thewindow.fdc3
global and the newfdc3Ready
event:
import { fdc3Ready, joinChannel, broadcast } from '@finos/fdc3'
await fdc3Ready(1000) // specify the amount of milliseconds to wait before a timeout error
await joinChannel('blue')
broadcast({
type: 'fdc3.contact',
id: {
email: 'jane.doe@mail.com'
}
})
- The
compareVersionNumbers()
andversionIsAtLeast()
functions can be used together withgetInfo()
for version checking:
import * as fdc3 from '@finos/fdc3'
const info = fdc3.getInfo()
if (fdc3.versionIsAtLeast(info, 1.2)) {
console.log('Version is >= 1.2')
}
🚀 New Features
- ES6 functions for
getInfo()
andraiseIntentForContext()
(#268, #324) fdc3Ready()
utility function that wraps checks for the window.fdc3 global object and newfdc3Ready
event (#360)compareVersionNumbers()
andversionIsAtLeast()
utility functions to complementgetInfo()
(#324)
💅 Enhancements
addContextListener(contextType, handler)
now supports passingnull
as the context type (#329)- All other API type changes and additions from the FDC3 Standard 1.2 release
👎 Deprecated
See CHANGELOG.md for more details.