How to use the snabbdom/thunk function in snabbdom

To help you get started, we’ve selected a few snabbdom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TylorS / snabbdom-selector / test / index.ts View on Github external
it('should be able to match thunks', () => {
      const exampleThunk = () => h('h2.thunk', {}, []);
      const vNode = h('div#test', {}, [
        thunk('div', 'thunk', exampleThunk, [7]),
      ]);

      const result = select('.thunk', vNode);
      assert.strictEqual(result[0].sel, 'h2.thunk');
    });
github TylorS / snabbdom-selector / test / index.js View on Github external
it('should be able to match thunks', done => {
    const exampleThunk = number => h('h2.thunk', {}, `${number}`)
    const vnode = h('div#test', [
      thunk('thunk', exampleThunk, 7)
    ])
    const result = selector('.thunk', vnode)
    assert.strictEqual(result[0].sel, 'h2.thunk')
    done()
  })