Skip to content

Commit

Permalink
improvement: allow assigning initialPossibleTypesMap for SSR use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyef committed Apr 17, 2020
1 parent 3110aa3 commit 5092aa0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/fragmentMatcher.js
Expand Up @@ -85,7 +85,10 @@ const strategies = {

export class ProgressiveFragmentMatcher {
constructor (options) {
const { strategy: name } = { ...defaultOptions, ...options }
const { strategy: name, initialPossibleTypesMap } = {
...defaultOptions,
...options
}

if (!strategies[name]) {
const strategyNames = Object.keys(strategies)
Expand All @@ -100,7 +103,7 @@ export class ProgressiveFragmentMatcher {
const strategy = strategies[name]

// initiate type map.
this.possibleTypesMap = {}
this.possibleTypesMap = initialPossibleTypesMap || {}
this.match = this.match.bind(this)

// set strategy based methods.
Expand Down

0 comments on commit 5092aa0

Please sign in to comment.