Skip to content

Commit 7079434

Browse files
committed
feat: add new func symbolHashJoin and rename shared file to symbolHash.js
1 parent a4fe03b commit 7079434

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

client/invoke.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import deserialize from '../shared/deserialize'
22
import prefix from '../shared/prefix'
3+
import { symbolHashJoin } from '../shared/symbolHash'
34
import page from './page'
45
import worker from './worker'
56
import client from './client'
@@ -13,7 +14,7 @@ export default function invoke(name, hash) {
1314
} else {
1415
worker.queues[name] = [...worker.queues[name], params]
1516
}
16-
let finalHash = hash === this.hash ? hash : `${hash}---${this.hash}`
17+
let finalHash = hash === this.hash ? hash : symbolHashJoin(hash, this.hash)
1718
let url = `${worker.api}/${prefix}/${finalHash}/${name}.json`
1819
if (module.hot) {
1920
const version = client.klasses[hash].__hashes[name]

server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import bodyParser from 'body-parser'
22
import express from 'express'
33
import path from 'path'
44
import deserialize from '../shared/deserialize'
5-
import symbolHashSplit from '../shared/symbolHashSplit'
5+
import { symbolHashSplit } from '../shared/symbolHash'
66
import prefix from '../shared/prefix'
77
import context, { getCurrentContext, generateCurrentContext } from './context'
88
import emulatePrerender from './emulatePrerender'

shared/symbolHash.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function symbolHashSplit(hash) {
2+
return hash.split('---')
3+
}
4+
5+
export function symbolHashJoin(hash, joinHash) {
6+
return `${hash}---${joinHash}`
7+
}

shared/symbolHashSplit.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)