Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@exodus/atoms

Package Overview
Dependencies
Maintainers
0
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/atoms - npm Package Compare versions

Comparing version 7.6.1 to 8.0.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [8.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.6.1...@exodus/atoms@8.0.0) (2024-07-17)
### ⚠ BREAKING CHANGES
- extract remote config atoms (#7817)
### Features
- **enhancers:** add compute asynchronous selector support ([#7873](https://github.com/ExodusMovement/exodus-hydra/issues/7873)) ([e62576e](https://github.com/ExodusMovement/exodus-hydra/commit/e62576e5a257f012a184e75a505c2381cc42e07c))
- extract remote config atoms ([#7817](https://github.com/ExodusMovement/exodus-hydra/issues/7817)) ([7c67be4](https://github.com/ExodusMovement/exodus-hydra/commit/7c67be43e1cdd8376cbf211a64e3fec9b049b90b))
## [7.6.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.6.0...@exodus/atoms@7.6.1) (2024-07-09)

@@ -8,0 +19,0 @@

2

lib/enhancers/compute.d.ts
import { Atom, ReadonlyAtom } from '../utils/types.js';
type Params<T, V> = {
atom: Atom<T> | ReadonlyAtom<T>;
selector: (value: T) => V;
selector: (value: T) => V | Promise<V>;
};
declare const compute: <T, V>({ atom, selector }: Params<T, V>) => ReadonlyAtom<V>;
export default compute;

@@ -12,4 +12,4 @@ const compute = ({ atom, selector }) => {

let called;
return atom.observe((values) => {
const selected = selector(values);
return atom.observe(async (values) => {
const selected = await selector(values);
if (called && prev === selected)

@@ -16,0 +16,0 @@ return;

export { default as createAtomMock } from './factories/memory.js';
export { default as createInMemoryAtom } from './factories/memory.js';
export { default as createStorageAtomFactory } from './factories/storage.js';
export { default as createRemoteConfigAtomFactory } from './factories/remote-config.js';
export { default as createKeystoreAtom } from './factories/keystore.js';
export { default as createSequencedKeystoreAtom } from './factories/sequenced-keystore.js';
export { default as createAtomObserver } from './factories/observer.js';
export { default as createSimpleObserver } from './simple-observer.js';
export { default as compute } from './enhancers/compute.js';

@@ -9,0 +9,0 @@ export { default as blockUntil } from './enhancers/block-until.js';

export { default as createAtomMock } from './factories/memory.js';
export { default as createInMemoryAtom } from './factories/memory.js';
export { default as createStorageAtomFactory } from './factories/storage.js';
export { default as createRemoteConfigAtomFactory } from './factories/remote-config.js';
export { default as createKeystoreAtom } from './factories/keystore.js';
export { default as createSequencedKeystoreAtom } from './factories/sequenced-keystore.js';
export { default as createAtomObserver } from './factories/observer.js';
export { default as createSimpleObserver } from './simple-observer.js';
export { default as compute } from './enhancers/compute.js';

@@ -9,0 +9,0 @@ export { default as blockUntil } from './enhancers/block-until.js';

{
"name": "@exodus/atoms",
"version": "7.6.1",
"version": "8.0.0",
"description": "Abstraction for encapsulating a piece of data behind a simple unified interface: get, set, observe",

@@ -44,3 +44,2 @@ "type": "module",

"@exodus/atom-tests": "^1.0.0",
"@exodus/remote-config": "^2.4.0",
"@exodus/storage-memory": "^2.1.1",

@@ -53,3 +52,3 @@ "@types/jest": "^29.5.11",

},
"gitHead": "4d0f338fc17d176f1293b54fc881914c62f0cfce"
"gitHead": "9c572ff7b092c5806e9de99a462775086689742c"
}

@@ -36,8 +36,3 @@ # `@exodus/atoms`

```js
import {
createInMemoryAtom,
createStorageAtomFactory,
createRemoteConfigAtomFactory,
fromEventEmitter,
} from '@exodus/atoms'
import { createInMemoryAtom, createStorageAtomFactory, fromEventEmitter } from '@exodus/atoms'

@@ -58,10 +53,2 @@ // In memory atoms

// Remote config atoms
const createRemoteConfigAtom = createRemoteConfigAtomFactory({ remoteConfig })
const fiatOnrampConfigAtom = createRemoteConfigAtom({
path: `dapps.fiatOnramp`,
defaultValue: {},
})
// Event emitter

@@ -68,0 +55,0 @@ const geolocationAtom = fromEventEmitter({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc