Skip to content

Commit 4447e81

Browse files
committed
fix: missing XStateServiceStatus export
1 parent 52a215d commit 4447e81

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.2.1] - 2022-07-22
9+
10+
### Fixes
11+
- Fix missing `XStateServiceStatus` export
12+
813
## [3.2.0] - 2022-07-22
914

1015
### Updates

dist/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1212
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1313
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1414
PERFORMANCE OF THIS SOFTWARE.
15-
***************************************************************************** */function t(e,n){var h="function"==typeof Symbol&&e[Symbol.iterator];if(!h)return e;var _,b,p=h.call(e),d=[];try{for(;(void 0===n||n-- >0)&&!(_=p.next()).done;)d.push(_.value)}catch(e){b={error:e}}finally{try{_&&!_.done&&(h=p.return)&&h.call(p)}finally{if(b)throw b.error}}return d}var b;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(b||(b={}));var p={type:"xstate.init"};function r(e){return void 0===e?[]:[].concat(e)}function i(e){return{type:"xstate.assign",assignment:e}}function o(e,n){return"string"==typeof(e="string"==typeof e&&n&&n[e]?n[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function a(e){return function(n){return e===n}}function u(e){return"string"==typeof e?{type:e}:e}function c(e,n){return{value:e,context:n,actions:[],changed:!1,matches:a(e)}}function f(e,n,h){var _=n,b=!1;return[e.filter((function(e){if("xstate.assign"===e.type){b=!0;var n=Object.assign({},_);return"function"==typeof e.assignment?n=e.assignment(_,h):Object.keys(e.assignment).forEach((function(b){n[b]="function"==typeof e.assignment[b]?e.assignment[b](_,h):e.assignment[b]})),_=n,!1}return!0})),_,b]}function s(e,n){void 0===n&&(n={});var h=t(f(r(e.states[e.initial].entry).map((function(e){return o(e,n.actions)})),e.context,p),2),_=h[0],b=h[1],d={config:e,_options:n,initialState:{value:e.initial,actions:_,context:b,matches:a(e.initial)},transition:function(n,h){var _,b,p="string"==typeof n?{value:n,context:e.context}:n,S=p.value,g=p.context,m=u(h),v=e.states[S];if(v.on){var y=r(v.on[m.type]);try{for(var T=function(e){var n="function"==typeof Symbol&&Symbol.iterator,h=n&&e[n],_=0;if(h)return h.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&_>=e.length&&(e=void 0),{value:e&&e[_++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),j=T.next();!j.done;j=T.next()){var x=j.value;if(void 0===x)return c(S,g);var w="string"==typeof x?{target:x}:x,k=w.target,C=w.actions,N=void 0===C?[]:C,I=w.cond,O=void 0===I?function(){return!0}:I,U=void 0===k,M=null!=k?k:S,R=e.states[M];if(O(g,m)){var D=t(f((U?r(N):[].concat(v.exit,N,R.entry).filter((function(e){return e}))).map((function(e){return o(e,d._options.actions)})),g,m),3),E=D[0],X=D[1],F=D[2],P=null!=k?k:S;return{value:P,context:X,actions:E,changed:k!==S||E.length>0||F,matches:a(P)}}}}catch(e){_={error:e}}finally{try{j&&!j.done&&(b=T.return)&&b.call(T)}finally{if(_)throw _.error}}}return c(S,g)}};return d}var l=function(e,n){return e.actions.forEach((function(h){var _=h.exec;return _&&_(e.context,n)}))};function interpret(e,n,h){const _=wrapXStateService(function(e){var n=e.initialState,h=b.NotStarted,_=new Set,d={_machine:e,send:function(p){h===b.Running&&(n=e.transition(n,p),l(n,u(p)),_.forEach((function(e){return e(n)})))},subscribe:function(e){return _.add(e),e(n),{unsubscribe:function(){return _.delete(e)}}},start:function(_){if(_){var S="object"==typeof _?_:{context:e.config.context,value:_};n={value:S.value,actions:[],context:S.context,matches:a(S.value)}}else n=e.initialState;return h=b.Running,l(n,p),d},stop:function(){return h=b.Stopped,_.clear(),d},get state(){return n},get status(){return h}};return d}(e),n,h);return _}function createXStateService(e,n,h,_){const b=interpret(n,h,_);return globalThis.__ficusjs__=globalThis.__ficusjs__||{},globalThis.__ficusjs__.xstate=globalThis.__ficusjs__.xstate||{},globalThis.__ficusjs__.xstate[e]=b,b}function addXStateService(e,n){return globalThis.__ficusjs__=globalThis.__ficusjs__||{},globalThis.__ficusjs__.xstate=globalThis.__ficusjs__.xstate||{},globalThis.__ficusjs__.xstate[e]=n,n}function getXStateService(e){if(globalThis.__ficusjs__&&globalThis.__ficusjs__.xstate&&globalThis.__ficusjs__.xstate[e])return globalThis.__ficusjs__.xstate[e]}export{e as BasePersist,n as Store,addXStateService,i as assign,createAppState,s as createMachine,createPersist,createStateMachine,createXStateService,getAppState,getXStateService,interpret,withLocalState,withStateMachine,withStore,withWorkerStore,withXStateService,wrapXStateService};
15+
***************************************************************************** */function t(e,n){var h="function"==typeof Symbol&&e[Symbol.iterator];if(!h)return e;var _,b,p=h.call(e),d=[];try{for(;(void 0===n||n-- >0)&&!(_=p.next()).done;)d.push(_.value)}catch(e){b={error:e}}finally{try{_&&!_.done&&(h=p.return)&&h.call(p)}finally{if(b)throw b.error}}return d}var b;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(b||(b={}));var p={type:"xstate.init"};function r(e){return void 0===e?[]:[].concat(e)}function i(e){return{type:"xstate.assign",assignment:e}}function o(e,n){return"string"==typeof(e="string"==typeof e&&n&&n[e]?n[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function a(e){return function(n){return e===n}}function u(e){return"string"==typeof e?{type:e}:e}function c(e,n){return{value:e,context:n,actions:[],changed:!1,matches:a(e)}}function f(e,n,h){var _=n,b=!1;return[e.filter((function(e){if("xstate.assign"===e.type){b=!0;var n=Object.assign({},_);return"function"==typeof e.assignment?n=e.assignment(_,h):Object.keys(e.assignment).forEach((function(b){n[b]="function"==typeof e.assignment[b]?e.assignment[b](_,h):e.assignment[b]})),_=n,!1}return!0})),_,b]}function s(e,n){void 0===n&&(n={});var h=t(f(r(e.states[e.initial].entry).map((function(e){return o(e,n.actions)})),e.context,p),2),_=h[0],b=h[1],d={config:e,_options:n,initialState:{value:e.initial,actions:_,context:b,matches:a(e.initial)},transition:function(n,h){var _,b,p="string"==typeof n?{value:n,context:e.context}:n,S=p.value,g=p.context,m=u(h),v=e.states[S];if(v.on){var y=r(v.on[m.type]);try{for(var T=function(e){var n="function"==typeof Symbol&&Symbol.iterator,h=n&&e[n],_=0;if(h)return h.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&_>=e.length&&(e=void 0),{value:e&&e[_++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),j=T.next();!j.done;j=T.next()){var x=j.value;if(void 0===x)return c(S,g);var w="string"==typeof x?{target:x}:x,k=w.target,C=w.actions,N=void 0===C?[]:C,I=w.cond,O=void 0===I?function(){return!0}:I,U=void 0===k,M=null!=k?k:S,R=e.states[M];if(O(g,m)){var D=t(f((U?r(N):[].concat(v.exit,N,R.entry).filter((function(e){return e}))).map((function(e){return o(e,d._options.actions)})),g,m),3),E=D[0],X=D[1],F=D[2],P=null!=k?k:S;return{value:P,context:X,actions:E,changed:k!==S||E.length>0||F,matches:a(P)}}}}catch(e){_={error:e}}finally{try{j&&!j.done&&(b=T.return)&&b.call(T)}finally{if(_)throw _.error}}}return c(S,g)}};return d}var l=function(e,n){return e.actions.forEach((function(h){var _=h.exec;return _&&_(e.context,n)}))};function interpret(e,n,h){const _=wrapXStateService(function(e){var n=e.initialState,h=b.NotStarted,_=new Set,d={_machine:e,send:function(p){h===b.Running&&(n=e.transition(n,p),l(n,u(p)),_.forEach((function(e){return e(n)})))},subscribe:function(e){return _.add(e),e(n),{unsubscribe:function(){return _.delete(e)}}},start:function(_){if(_){var S="object"==typeof _?_:{context:e.config.context,value:_};n={value:S.value,actions:[],context:S.context,matches:a(S.value)}}else n=e.initialState;return h=b.Running,l(n,p),d},stop:function(){return h=b.Stopped,_.clear(),d},get state(){return n},get status(){return h}};return d}(e),n,h);return _}function createXStateService(e,n,h,_){const b=interpret(n,h,_);return globalThis.__ficusjs__=globalThis.__ficusjs__||{},globalThis.__ficusjs__.xstate=globalThis.__ficusjs__.xstate||{},globalThis.__ficusjs__.xstate[e]=b,b}function addXStateService(e,n){return globalThis.__ficusjs__=globalThis.__ficusjs__||{},globalThis.__ficusjs__.xstate=globalThis.__ficusjs__.xstate||{},globalThis.__ficusjs__.xstate[e]=n,n}function getXStateService(e){if(globalThis.__ficusjs__&&globalThis.__ficusjs__.xstate&&globalThis.__ficusjs__.xstate[e])return globalThis.__ficusjs__.xstate[e]}export{e as BasePersist,n as Store,_ as XStateServiceStatus,addXStateService,i as assign,createAppState,s as createMachine,createPersist,createStateMachine,createXStateService,getAppState,getXStateService,interpret,withLocalState,withStateMachine,withStore,withWorkerStore,withXStateService,wrapXStateService};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ficusjs/state",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"description": "State functions for FicusJS",
55
"type": "module",
66
"main": "dist/index.mjs",

src/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import { withStore } from './with-store.mjs'
77
import { withXStateService } from './with-xstate-service.mjs'
88
import { withWorkerStore } from './with-worker-store.mjs'
99
import { Store } from './store.mjs'
10-
import { addXStateService, assign, createMachine, createXStateService, getXStateService, interpret, wrapXStateService } from './xstate-service.mjs'
10+
import { XStateServiceStatus, addXStateService, assign, createMachine, createXStateService, getXStateService, interpret, wrapXStateService } from './xstate-service.mjs'
1111

1212
export {
13+
XStateServiceStatus,
1314
addXStateService,
1415
assign,
1516
BasePersist,

0 commit comments

Comments
 (0)