@fox-lms/data

1.0.2 • Public • Published

Data

FoxLMS Admin data store and utilities.

Installation

Install the module

npm install -s @fox-lms/data

This package assumes that your code will run in an ES2015+ environment. If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using core-js or @babel/polyfill will add support for these methods. Learn more about it in Babel docs.

Usage

import { coursesStore } from '@fox-lms/data';
import { useSelect } from '@wordpress/data';

function MyCourses() {
    const courses = useSelect( select => {
        return select( coursesStore ).getCourses();
    } );
    return (
        <ul>
            { courses.map( course => (
                <li>{ course.title }</li>
            ) ) }
        </ul>
    );
}

Readme

Keywords

Package Sidebar

Install

npm i @fox-lms/data

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

152 kB

Total Files

92

Last publish

Collaborators

  • levonmidoyan