MCPcopy
hub / github.com/pqina/filepond / createOptionAPI

Function createOptionAPI

src/js/app/utils/createOptionAPI.js:4–17  ·  view source on GitHub ↗
(store, options)

Source from the content-addressed store, hash-verified

2import { forin } from '../../utils/forin';
3
4export const createOptionAPI = (store, options) => {
5 const obj = {};
6 forin(options, key => {
7 obj[key] = {
8 get: () => store.getState().options[key],
9 set: value => {
10 store.dispatch(`SET_${fromCamels(key, '_').toUpperCase()}`, {
11 value
12 });
13 }
14 };
15 });
16 return obj;
17};

Callers 1

createAppFunction · 0.90

Calls 2

forinFunction · 0.90
fromCamelsFunction · 0.90

Tested by

no test coverage detected