@thewillhuang/scorm-hook

4.0.4 • Public • Published

usage

import React from "react";
import scormHook from "@thewillhuang/scorm-hook";

const LMS = () => {
  const [state, setState] = scormHook({
    state: {},
    setState: () => {},
    config: {},
  }); // starting state as state, config is an object with methods matching SCORM2004 standards methods visit https://scorm.com/scorm-explained/technical-scorm/run-time/ for more details
  console.log({ state });
  useEffect(() => {
    uploadToServer(state);
  }, [state]);
  return (
    <div>
      <button
        onCLick={() => {
          window.open(url);
        }}
      >
        {"open course"}
      </button>
    </div>
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @thewillhuang/scorm-hook

Weekly Downloads

0

Version

4.0.4

License

MIT

Unpacked Size

301 kB

Total Files

13

Last publish

Collaborators

  • thewillhuang