3.0.1 • Published 5 months ago

@exodus/remote-config v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@exodus/remote-config

This module provides simplified access to remote config values

Install

yarn add @exodus/remote-config

Usage

This feature is designed to be used together with @exodus/headless. See using the sdk.

Play with it

  1. Open the playground https://exodus-hydra.pages.dev/features/remote-config
  2. Try out the some methods via the UI. These corresponds 1:1 with the exodus.remoteConfig API.
  3. Run await exodus.remoteConfig.get('assets.algorand.blockExplorer') in the Dev Tools Console.

API Side

See using the sdk for more details on how features plug into the SDK and the API interface in the type declaration.

const { addressUrl, txUrl } = await exodus.remoteConfig.get('core.wallet.sunsetAssets')

const config = await exodus.remoteConfig.getAll()

If you're building a feature that requires values from the remote config, you can use remote-config-atoms to subscribe to slices of the remote config. The following example demonstrates how to use remote config atoms to create an atom that subscribes to the core.exchange.preferSameNetworkUsdThreshold value:

import { createRemoteConfigAtomFactory } from '@exodus/atoms'

// below definition can be shipped with a feature and depended on by other nodes by specifying 'sameNetworkUsdThresholdAtom' as dependency
const sameNetworkUsdThresholdAtom = {
  id: 'sameNetworkUsdThresholdAtom',
  factory({ remoteConfig }) {
    const createRemoteConfigAtom = createRemoteConfigAtomFactory({ remoteConfig })
    const atom = createRemoteConfigAtom({
      path: 'core.exchange.preferSameNetworkUsdThreshold',
      defaultValue: 42,
    })

    return atom
  },
  dependencies: ['remoteConfig'],
}

UI Side

See using the sdk for more details on basic UI-side setup.

import { selectors } from '~/ui/flux'

const MyComponent = () => {
  const preferSameNetworkUsdThreshold = useSelector(
    selectors.remoteConfig.get('core.exchange.preferSameNetworkUsdThreshold')
  )
}
3.0.1

5 months ago

3.0.0

7 months ago

2.10.0

8 months ago

2.9.3

8 months ago

2.9.2

8 months ago

2.9.1

8 months ago

2.9.0

9 months ago

2.8.0

11 months ago

2.7.2

1 year ago

2.7.1

1 year ago

2.7.0

1 year ago

2.6.0

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.5.0

1 year ago

2.4.0

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

6 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago