UNPKG

@ghostry/finity-solidjs

Version:

Finite state management with exhaustiveness and transition enforcement for TypeScript.

2 lines 1.34 kB
import*as r from"solid-js/web";import*as t from"solid-js";function e(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function n(n){return(0,r.createComponent)(t.Switch,{get children(){return(0,r.createComponent)(t.For,{get each(){return n.cases},children:function(o){var a=function(r){if(Array.isArray(r))return r}(o)||function(r,t){var e,n,o=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(r);!(i=(e=o.next()).done)&&(a.push(e.value),a.length!==t);i=!0);}catch(r){l=!0,n=r}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(o,2)||function(r,t){if(r){if("string"==typeof r)return e(r,2);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],l=a[1];return(0,r.createComponent)(t.Match,{get when(){return i.includes(n.state().kind)},get children(){return l(n.state())}})}})}})}export{n as Render}; //# sourceMappingURL=Render.js.map