Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design default API for icon package #21

Closed
bartaxyz opened this issue May 2, 2018 · 0 comments
Closed

Design default API for icon package #21

bartaxyz opened this issue May 2, 2018 · 0 comments

Comments

@bartaxyz
Copy link
Owner

bartaxyz commented May 2, 2018

This package will be used even by packages scoped inside of this one. Therefore it should have nice and expandable API. This issue will cover how will it look.

import XYZIconSet from 'xyz-icon-set';

/*
 *  [ iconName: string ]: Icon
 *  returns all icon names in dash-case format
 */

const paperPlane = XYZIconSet.PaperPlane;
paperPlane.name === 'paper-plane';
paperPlane.source === '<svg wid...';

Import just specific icon

import { PaperPlane } from 'xyz-icon-set';

/*
 *  Icon object
 *  {
 *    name: string,
 *    source: string,
 *  }
 */

PaperPlane.name === 'paper-plane';
PaperPlane.source === '<svg width="24" height="24"><path style="fill:#000" ...';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant