Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
ncthbrt committed Apr 17, 2018
1 parent f2269fd commit 26721cd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test-watch": "jest --coverage --watch",
"coverage": "nyc report --temp-directory=coverage --reporter=text-lcov | coveralls",
"pretest": "yarn run build",
"prepush": "yarn run local-test",
"prepush": "yarn run build && yarn run local-test",
"prepare": "yarn run clean && yarn run build"
},
"keywords": [
Expand Down
26 changes: 19 additions & 7 deletions src/Nact.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var $$String = require("bs-platform/lib/js/string.js");
var Js_option = require("bs-platform/lib/js/js_option.js");
var Caml_int32 = require("bs-platform/lib/js/caml_int32.js");
var Nact_jsMap = require("./Nact_jsMap.js");
var Belt_Option = require("bs-platform/lib/js/belt_Option.js");
var Js_primitive = require("bs-platform/lib/js/js_primitive.js");
var Belt_SetString = require("bs-platform/lib/js/belt_SetString.js");
var Caml_exceptions = require("bs-platform/lib/js/caml_exceptions.js");
Expand Down Expand Up @@ -55,10 +56,15 @@ function toString(param) {
return "system:" + (path.system + ("//" + $$String.concat("/", path.parts)));
}

function parts(param) {
return param[0].parts;
}

var ActorPath = /* module */[
/* fromReference */fromReference,
/* systemName */systemName,
/* toString */toString
/* toString */toString,
/* parts */parts
];


Expand Down Expand Up @@ -349,12 +355,18 @@ function spawnPersistent(key, name, shutdownAfter, snapshotEvery, onCrash, decod
var decoder$1 = defaultTo((function (prim) {
return unsafeDecoder(prim);
}), decoder);
var stateDecoder$1 = defaultTo((function (prim) {
return unsafeDecoder(prim);
}), stateDecoder);
var stateEncoder$1 = defaultTo((function (prim) {
return unsafeEncoder(prim);
}), stateEncoder);
var match = Belt_Option.isSome(snapshotEvery);
var stateDecoder$1 = defaultTo(match ? (function (prim) {
return unsafeDecoder(prim);
}) : (function (prim) {
return prim;
}), stateDecoder);
var match$1 = Belt_Option.isSome(snapshotEvery);
var stateEncoder$1 = defaultTo(match$1 ? (function (prim) {
return unsafeEncoder(prim);
}) : (function (prim) {
return prim;
}), stateEncoder);
var encoder$1 = defaultTo((function (prim) {
return unsafeEncoder(prim);
}), encoder);
Expand Down
4 changes: 3 additions & 1 deletion src/Nact.re
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function unsafeDecoder(result) {

external magicDecoder : Js.Json.t => 'msg = "%identity";

external magicEncoder : 'msg => Js.Json.t = "%identity";

[@bs.val] external unsafeEncoder : 'msg => Js.Json.t = "unsafeEncoder";

module Log = {
Expand Down Expand Up @@ -361,7 +363,7 @@ let spawnPersistent =
let stateEncoder =
stateEncoder
|> defaultTo(
Belt.Option.isSome(snapshotEvery) ? unsafeDecoder : magicDecoder,
Belt.Option.isSome(snapshotEvery) ? unsafeEncoder : magicEncoder,
);
let encoder = encoder |> defaultTo(unsafeEncoder);
let options: Nact_bindings.persistentActorOptions('msg, 'parentMsg) = {
Expand Down
1 change: 1 addition & 0 deletions src/Nact.rei
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module ActorPath: {
let fromReference: actorRef(_) => actorPath;
let systemName: actorPath => string;
let toString: actorPath => string;
let parts: actorPath => list(string);
};

module Log: {
Expand Down

0 comments on commit 26721cd

Please sign in to comment.