charting refactor into shapes, not debugged
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
|
||||
export function mixin(child, ...parents) {
|
||||
for( const parent of parents ) {
|
||||
for ( const key in parent) {
|
||||
if (parent.hasOwnProperty(key)) {
|
||||
child[key] = parent[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
|
||||
export function prototype(parent, child) {
|
||||
const result = Object.create(parent);
|
||||
Object.assign(result, child)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
export function encodeIEE754(value) {
|
||||
const buffer = new ArrayBuffer(4);
|
||||
const view = new DataView(buffer);
|
||||
view.setFloat32(0, value, false /* big endian */);
|
||||
return view.getUint32(0, false);
|
||||
}
|
||||
|
||||
|
||||
export function decodeIEE754(value) {
|
||||
const buffer = new ArrayBuffer(4);
|
||||
const view = new DataView(buffer);
|
||||
view.setUint32(0, value, false)
|
||||
return view.getFloat32(0, false)
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export function subOHLCs( chainId, poolPeriods ) {
|
||||
socket.emit('subOHLCs', chainId, toSub)
|
||||
}
|
||||
|
||||
export function unsubPrices( chainId, poolPeriods ) {
|
||||
export function unsubOHLCs( chainId, poolPeriods ) {
|
||||
const toUnsub = []
|
||||
for( const [pool,period] of poolPeriods ) {
|
||||
const key = `${pool}|${period}`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {uint32max, uint64max} from "@/misc.js";
|
||||
import {decodeIEE754, encodeIEE754} from "@/blockchain/common.js";
|
||||
import {decodeIEE754, encodeIEE754} from "@/common.js";
|
||||
|
||||
export const MAX_FRACTION = 65535;
|
||||
export const NO_CHAIN = uint64max;
|
||||
|
||||
Reference in New Issue
Block a user