Snippets

Erwin Goossen React, flow Object functions

Created by Erwin Goossen
1
2
3
4
5
6
// @flow

export const getEntries =
  <Obj:Object>(value: Obj): Array<[$Keys<Obj>, $Values<Obj>]> => Object.entries(value);

export default null;
1
2
3
4
5
6
// @flow

export const getKeys =
  <Obj:Object>(value: Obj): Array<$Keys<Obj>> => Object.keys(value);

export default null;
1
2
3
4
5
6
// @flow

export const getValues =
  <Obj:Object>(values: Obj): Array<$Values<Obj>> => Object.values(values);

export default null;
// @flow

import { getValues } from './getValues';
import { getKeys } from './getKeys';
import { getEntries } from './getEntries';

export {
  getValues,
  getKeys,
  getEntries,
};

export default null;

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.